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

Function getTextColor

src/components/HelperText/utils.ts:11–30  ·  view source on GitHub ↗
({ theme, disabled, type }: BaseProps)

Source from the content-addressed store, hash-verified

9};
10
11export function getTextColor({ theme, disabled, type }: BaseProps) {
12 const { colors, dark } = theme;
13
14 if (type === 'error') {
15 return colors?.error;
16 }
17
18 if (theme.isV3) {
19 if (disabled) {
20 return theme.colors.onSurfaceDisabled;
21 } else {
22 return theme.colors.onSurfaceVariant;
23 }
24 }
25
26 return color(theme?.colors?.text)
27 .alpha(dark ? 0.7 : 0.54)
28 .rgb()
29 .string();
30}

Callers 1

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