ICS React Native App
1/**
2 * Learn more about light and dark modes:
3 * https://docs.expo.dev/guides/color-schemes/
4 */
5
6import { Colors } from "@/constants/theme";
7import { useColorScheme } from "@/hooks/use-color-scheme";
8
9export function useThemeColor(
10 props: { light?: string; dark?: string },
11 colorName: keyof typeof Colors.light & keyof typeof Colors.dark,
12) {
13 const theme = useColorScheme() ?? "light";
14 const colorFromProps = props[theme];
15
16 return colorFromProps || Colors[theme][colorName];
17}