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

Function getInputTextColor

src/components/TextInput/helpers.tsx:314–336  ·  view source on GitHub ↗
({
  theme,
  textColor,
  disabled,
}: BaseProps & { textColor?: string })

Source from the content-addressed store, hash-verified

312type Mode = 'flat' | 'outlined';
313
314const getInputTextColor = ({
315 theme,
316 textColor,
317 disabled,
318}: BaseProps & { textColor?: string }) => {
319 if (textColor) {
320 return textColor;
321 }
322
323 if (theme.isV3) {
324 if (disabled) {
325 return theme.colors.onSurfaceDisabled;
326 }
327
328 return theme.colors.onSurface;
329 }
330
331 if (disabled) {
332 return color(theme.colors.text).alpha(0.54).rgb().string();
333 }
334
335 return theme.colors.text;
336};
337
338const getActiveColor = ({
339 theme,

Callers 2

getFlatInputColorsFunction · 0.85
getOutlinedInputColorsFunction · 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…