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

Function getFlatInputColors

src/components/TextInput/helpers.tsx:480–520  ·  view source on GitHub ↗
({
  underlineColor,
  activeUnderlineColor,
  customSelectionColor,
  textColor,
  disabled,
  error,
  theme,
}: {
  underlineColor?: string;
  activeUnderlineColor?: string;
  customSelectionColor?: string;
  textColor?: string;
  disabled?: boolean;
  error?: boolean;
  theme: InternalTheme;
})

Source from the content-addressed store, hash-verified

478};
479
480export const getFlatInputColors = ({
481 underlineColor,
482 activeUnderlineColor,
483 customSelectionColor,
484 textColor,
485 disabled,
486 error,
487 theme,
488}: {
489 underlineColor?: string;
490 activeUnderlineColor?: string;
491 customSelectionColor?: string;
492 textColor?: string;
493 disabled?: boolean;
494 error?: boolean;
495 theme: InternalTheme;
496}) => {
497 const baseFlatColorProps = { theme, disabled };
498 const activeColor = getActiveColor({
499 ...baseFlatColorProps,
500 error,
501 activeUnderlineColor,
502 mode: 'flat',
503 });
504
505 return {
506 inputTextColor: getInputTextColor({
507 ...baseFlatColorProps,
508 textColor,
509 }),
510 activeColor,
511 underlineColorCustom: getFlatUnderlineColor({
512 ...baseFlatColorProps,
513 underlineColor,
514 }),
515 placeholderColor: getPlaceholderColor(baseFlatColorProps),
516 selectionColor: getSelectionColor({ activeColor, customSelectionColor }),
517 errorColor: theme.colors.error,
518 backgroundColor: getFlatBackgroundColor(baseFlatColorProps),
519 };
520};
521
522export const getOutlinedInputColors = ({
523 activeOutlineColor,

Callers 2

TextInputFlatFunction · 0.90
TextInput.test.tsxFile · 0.90

Calls 6

getActiveColorFunction · 0.85
getInputTextColorFunction · 0.85
getFlatUnderlineColorFunction · 0.85
getPlaceholderColorFunction · 0.85
getSelectionColorFunction · 0.85
getFlatBackgroundColorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…