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

Function getBorderColor

src/components/Chip/helpers.tsx:18–57  ·  view source on GitHub ↗
({
  theme,
  isOutlined,
  disabled,
  selectedColor,
  backgroundColor,
}: BaseProps & { backgroundColor: string; selectedColor?: string })

Source from the content-addressed store, hash-verified

16};
17
18const getBorderColor = ({
19 theme,
20 isOutlined,
21 disabled,
22 selectedColor,
23 backgroundColor,
24}: BaseProps & { backgroundColor: string; selectedColor?: string }) => {
25 const isSelectedColor = selectedColor !== undefined;
26
27 if (theme.isV3) {
28 if (!isOutlined) {
29 // If the Chip mode is "flat", set border color to transparent
30 return 'transparent';
31 }
32
33 if (disabled) {
34 return color(theme.colors.onSurfaceVariant).alpha(0.12).rgb().string();
35 }
36
37 if (isSelectedColor) {
38 return color(selectedColor).alpha(0.29).rgb().string();
39 }
40
41 return theme.colors.outline;
42 }
43
44 if (isOutlined) {
45 if (isSelectedColor) {
46 return color(selectedColor).alpha(0.29).rgb().string();
47 }
48
49 if (theme.dark) {
50 return color(white).alpha(0.29).rgb().string();
51 }
52
53 return color(black).alpha(0.29).rgb().string();
54 }
55
56 return backgroundColor;
57};
58
59const getTextColor = ({
60 theme,

Callers 1

getChipColorsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…