7 lines
No EOL
279 B
TypeScript
7 lines
No EOL
279 B
TypeScript
import { useColorScheme } from "react-native";
|
|
import colors from "../constants/colors"
|
|
|
|
export function useThemeColor(colorName: keyof typeof colors.light & keyof typeof colors.dark): string {
|
|
const theme = useColorScheme() ?? "light";
|
|
return colors[theme][colorName];
|
|
} |