This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
interaktive-systeme/hooks/hooks.ts
Thomas Schleicher 74c0fdb27e theme changes
2023-11-30 19:51:36 +01:00

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];
}