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

Function getIconColor

src/components/TextInput/Adornment/utils.ts:23–48  ·  view source on GitHub ↗
({
  theme,
  isTextInputFocused,
  disabled,
  customColor,
}: BaseProps & {
  isTextInputFocused: boolean;
  customColor?: ((isTextInputFocused: boolean) => string | undefined) | string;
})

Source from the content-addressed store, hash-verified

21}
22
23export function getIconColor({
24 theme,
25 isTextInputFocused,
26 disabled,
27 customColor,
28}: BaseProps & {
29 isTextInputFocused: boolean;
30 customColor?: ((isTextInputFocused: boolean) => string | undefined) | string;
31}) {
32 if (typeof customColor === 'function') {
33 return customColor(isTextInputFocused);
34 }
35 if (customColor) {
36 return customColor;
37 }
38
39 if (!theme.isV3) {
40 return theme.colors.text;
41 }
42
43 if (disabled) {
44 return theme.colors.onSurfaceDisabled;
45 }
46
47 return theme.colors.onSurfaceVariant;
48}

Callers 1

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