MCPcopy Create free account
hub / github.com/callstack/react-native-paper / getLabelColor

Function getLabelColor

src/components/BottomNavigation/utils.ts:47–70  ·  view source on GitHub ↗
({
  tintColor,
  hasColor,
  focused,
  defaultColor,
  theme,
}: BaseProps & {
  tintColor: string;
  hasColor: boolean;
  focused: boolean;
})

Source from the content-addressed store, hash-verified

45};
46
47export const getLabelColor = ({
48 tintColor,
49 hasColor,
50 focused,
51 defaultColor,
52 theme,
53}: BaseProps & {
54 tintColor: string;
55 hasColor: boolean;
56 focused: boolean;
57}) => {
58 if (hasColor) {
59 return tintColor;
60 }
61
62 if (theme.isV3) {
63 if (focused) {
64 return theme.colors.onSurface;
65 }
66 return theme.colors.onSurfaceVariant;
67 }
68
69 return defaultColor;
70};

Callers 1

BottomNavigationBarFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…