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

Function getAndroidControlColor

src/components/Checkbox/utils.ts:64–88  ·  view source on GitHub ↗
({
  theme,
  checked,
  disabled,
  checkedColor,
  uncheckedColor,
}: {
  theme: InternalTheme;
  checked: boolean;
  checkedColor: string;
  uncheckedColor: string;
  disabled?: boolean;
})

Source from the content-addressed store, hash-verified

62};
63
64const getAndroidControlColor = ({
65 theme,
66 checked,
67 disabled,
68 checkedColor,
69 uncheckedColor,
70}: {
71 theme: InternalTheme;
72 checked: boolean;
73 checkedColor: string;
74 uncheckedColor: string;
75 disabled?: boolean;
76}) => {
77 if (disabled) {
78 if (theme.isV3) {
79 return theme.colors.onSurfaceDisabled;
80 }
81 return theme.colors.disabled;
82 }
83
84 if (checked) {
85 return checkedColor;
86 }
87 return uncheckedColor;
88};
89
90export const getAndroidSelectionControlColor = ({
91 theme,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…