/**
 * Learn more about light and dark modes:
 * https://docs.expo.dev/guides/color-schemes/
 */

import { Themes } from '../theme';
import { useColorScheme } from '../hooks/use-color-scheme';

export function useThemeColor(
  colorName: keyof typeof Themes.dark.colors,
  theme?: 'light' | 'dark'
) {
  const scheme = theme ?? useColorScheme() ?? 'light';
  return scheme === 'dark'
    ? Themes.dark.colors[colorName]
    : Themes.light.colors[colorName];
}
