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

Function getUnderlayColor

src/components/TouchableRipple/utils.ts:7–25  ·  view source on GitHub ↗
({
  theme,
  calculatedRippleColor,
  underlayColor,
}: {
  theme: InternalTheme;
  calculatedRippleColor: ColorValue;
  underlayColor?: string;
})

Source from the content-addressed store, hash-verified

5import type { InternalTheme } from '../../types';
6
7const getUnderlayColor = ({
8 theme,
9 calculatedRippleColor,
10 underlayColor,
11}: {
12 theme: InternalTheme;
13 calculatedRippleColor: ColorValue;
14 underlayColor?: string;
15}) => {
16 if (underlayColor != null) {
17 return underlayColor;
18 }
19
20 if (theme.isV3) {
21 return color(calculatedRippleColor).rgb().string();
22 }
23
24 return color(calculatedRippleColor).fade(0.5).rgb().string();
25};
26
27const getRippleColor = ({
28 theme,

Callers 1

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