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

Function getIconColor

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

Source from the content-addressed store, hash-verified

198};
199
200const getIconColor = ({
201 theme,
202 isOutlined,
203 disabled,
204 selectedColor,
205}: BaseProps & {
206 selectedColor?: string;
207}) => {
208 const isSelectedColor = selectedColor !== undefined;
209 if (theme.isV3) {
210 if (disabled) {
211 return theme.colors.onSurfaceDisabled;
212 }
213
214 if (isSelectedColor) {
215 return selectedColor;
216 }
217
218 if (isOutlined) {
219 return theme.colors.onSurfaceVariant;
220 }
221
222 return theme.colors.onSecondaryContainer;
223 }
224
225 if (disabled) {
226 return theme.colors.disabled;
227 }
228
229 if (isSelectedColor) {
230 return color(selectedColor).alpha(0.54).rgb().string();
231 }
232
233 return color(theme.colors.text).alpha(0.54).rgb().string();
234};
235
236const getRippleColor = ({
237 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…