MCPcopy
hub / github.com/callstack/react-native-paper / getContrastingColor

Function getContrastingColor

src/utils/getContrastingColor.tsx:5–15  ·  view source on GitHub ↗
(
  input: ColorValue,
  light: string,
  dark: string
)

Source from the content-addressed store, hash-verified

3import color from 'color';
4
5export default function getContrastingColor(
6 input: ColorValue,
7 light: string,
8 dark: string
9): string {
10 if (typeof input === 'string') {
11 return color(input).isLight() ? dark : light;
12 }
13
14 return light;
15}

Callers 5

BadgeFunction · 0.85
AvatarTextFunction · 0.85
AvatarFunction · 0.85
FAB.test.tsxFile · 0.85
getForegroundColorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…