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

Function isDark

src/components/Button/utils.tsx:22–42  ·  view source on GitHub ↗
({
  dark,
  backgroundColor,
}: {
  dark?: boolean;
  backgroundColor?: string;
})

Source from the content-addressed store, hash-verified

20};
21
22const isDark = ({
23 dark,
24 backgroundColor,
25}: {
26 dark?: boolean;
27 backgroundColor?: string;
28}) => {
29 if (typeof dark === 'boolean') {
30 return dark;
31 }
32
33 if (backgroundColor === 'transparent') {
34 return false;
35 }
36
37 if (backgroundColor !== 'transparent') {
38 return !color(backgroundColor).isLight();
39 }
40
41 return false;
42};
43
44const getButtonBackgroundColor = ({
45 isMode,

Callers 1

getButtonTextColorFunction · 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…