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

Function getActiveColor

src/components/TextInput/helpers.tsx:338–371  ·  view source on GitHub ↗
({
  theme,
  disabled,
  error,
  activeUnderlineColor,
  activeOutlineColor,
  mode,
}: BaseProps & {
  error?: boolean;
  activeUnderlineColor?: string;
  activeOutlineColor?: string;
  mode?: Mode;
})

Source from the content-addressed store, hash-verified

336};
337
338const getActiveColor = ({
339 theme,
340 disabled,
341 error,
342 activeUnderlineColor,
343 activeOutlineColor,
344 mode,
345}: BaseProps & {
346 error?: boolean;
347 activeUnderlineColor?: string;
348 activeOutlineColor?: string;
349 mode?: Mode;
350}) => {
351 const isFlat = mode === 'flat';
352 const modeColor = isFlat ? activeUnderlineColor : activeOutlineColor;
353
354 if (error) {
355 return theme.colors.error;
356 }
357
358 if (modeColor) {
359 return modeColor;
360 }
361
362 if (disabled) {
363 if (theme.isV3) {
364 return theme.colors.onSurfaceDisabled;
365 }
366
367 return color(theme.colors.text).alpha(0.54).rgb().string();
368 }
369
370 return theme.colors.primary;
371};
372
373const getPlaceholderColor = ({ theme, disabled }: BaseProps) => {
374 if (theme.isV3) {

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…