@oxyhq/services
Version:
27 lines (25 loc) • 756 B
JavaScript
;
import { useMemo } from 'react';
import { useColorScheme } from "./useColorScheme.js";
import { Colors } from "../constants/theme.js";
/**
* Reusable hook to get theme colors based on current color scheme
* Returns the Colors object for the current theme (light or dark)
*
* @returns Colors object for the current color scheme
*
* @example
* ```tsx
* const colors = useThemeColors();
* <View style={{ backgroundColor: colors.background }}>
* <Text style={{ color: colors.text }}>Hello</Text>
* </View>
* ```
*/
export const useThemeColors = () => {
const colorScheme = useColorScheme();
return useMemo(() => {
return Colors[colorScheme ?? 'light'];
}, [colorScheme]);
};
//# sourceMappingURL=useThemeColors.js.map