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

Function getChipColors

src/components/Chip/helpers.tsx:275–326  ·  view source on GitHub ↗
({
  isOutlined,
  theme,
  selectedColor,
  showSelectedOverlay,
  customBackgroundColor,
  disabled,
  customRippleColor,
}: BaseProps & {
  customBackgroundColor?: ColorValue;
  disabled?: boolean;
  showSelectedOverlay?: boolean;
  selectedColor?: string;
  customRippleColor?: ColorValue;
})

Source from the content-addressed store, hash-verified

273};
274
275export const getChipColors = ({
276 isOutlined,
277 theme,
278 selectedColor,
279 showSelectedOverlay,
280 customBackgroundColor,
281 disabled,
282 customRippleColor,
283}: BaseProps & {
284 customBackgroundColor?: ColorValue;
285 disabled?: boolean;
286 showSelectedOverlay?: boolean;
287 selectedColor?: string;
288 customRippleColor?: ColorValue;
289}) => {
290 const baseChipColorProps = { theme, isOutlined, disabled };
291
292 const backgroundColor = getBackgroundColor({
293 ...baseChipColorProps,
294 customBackgroundColor,
295 });
296
297 const selectedBackgroundColor = getSelectedBackgroundColor({
298 ...baseChipColorProps,
299 customBackgroundColor,
300 showSelectedOverlay,
301 });
302
303 return {
304 borderColor: getBorderColor({
305 ...baseChipColorProps,
306 selectedColor,
307 backgroundColor,
308 }),
309 textColor: getTextColor({
310 ...baseChipColorProps,
311 selectedColor,
312 }),
313 iconColor: getIconColor({
314 ...baseChipColorProps,
315 selectedColor,
316 }),
317 rippleColor: getRippleColor({
318 ...baseChipColorProps,
319 selectedColor,
320 selectedBackgroundColor,
321 customRippleColor,
322 }),
323 backgroundColor,
324 selectedBackgroundColor,
325 };
326};

Callers 2

ChipFunction · 0.90
Chip.test.tsxFile · 0.90

Calls 6

getBackgroundColorFunction · 0.70
getBorderColorFunction · 0.70
getTextColorFunction · 0.70
getIconColorFunction · 0.70
getRippleColorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…