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

Function getBackgroundColor

src/components/Chip/helpers.tsx:118–140  ·  view source on GitHub ↗
({
  theme,
  isOutlined,
  disabled,
  customBackgroundColor,
}: BaseProps & {
  customBackgroundColor?: ColorValue;
})

Source from the content-addressed store, hash-verified

116};
117
118const getBackgroundColor = ({
119 theme,
120 isOutlined,
121 disabled,
122 customBackgroundColor,
123}: BaseProps & {
124 customBackgroundColor?: ColorValue;
125}) => {
126 if (typeof customBackgroundColor === 'string') {
127 return customBackgroundColor;
128 }
129
130 if (theme.isV3) {
131 if (disabled) {
132 if (isOutlined) {
133 return 'transparent';
134 }
135 return color(theme.colors.onSurfaceVariant).alpha(0.12).rgb().string();
136 }
137 }
138
139 return getDefaultBackgroundColor({ theme, isOutlined });
140};
141
142const getSelectedBackgroundColor = ({
143 theme,

Callers 2

getChipColorsFunction · 0.70

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…