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

Function getOnTintColor

src/components/Switch/utils.ts:68–98  ·  view source on GitHub ↗
({
  theme,
  disabled,
  value,
  checkedColor,
}: BaseProps & { checkedColor: string })

Source from the content-addressed store, hash-verified

66};
67
68const getOnTintColor = ({
69 theme,
70 disabled,
71 value,
72 checkedColor,
73}: BaseProps & { checkedColor: string }) => {
74 const isIOS = Platform.OS === 'ios';
75
76 if (isIOS) {
77 return checkedColor;
78 }
79
80 if (disabled) {
81 if (theme.dark) {
82 if (theme.isV3) {
83 return setColor(white).alpha(0.06).rgb().string();
84 }
85 return setColor(white).alpha(0.1).rgb().string();
86 }
87 return setColor(black).alpha(0.12).rgb().string();
88 }
89
90 if (value) {
91 return setColor(checkedColor).alpha(0.5).rgb().string();
92 }
93
94 if (theme.dark) {
95 return grey700;
96 }
97 return 'rgb(178, 175, 177)';
98};
99
100export const getSwitchColor = ({
101 theme,

Callers 1

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