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

Function getMatchingColor

docs/src/utils/themes.tsx:129–144  ·  view source on GitHub ↗
(
  colorName: string,
  theme: Record<string, any>
)

Source from the content-addressed store, hash-verified

127};
128
129export const getMatchingColor = (
130 colorName: string,
131 theme: Record<string, any>
132) => {
133 if (colorName === 'outline') {
134 return theme.surface;
135 }
136
137 if (colorName.startsWith('on')) {
138 const key = camelCase(colorName.slice(2));
139 return theme[key];
140 }
141
142 const key = `on${camelCase(colorName, { pascalCase: true })}`;
143 return theme[key];
144};
145
146const prepareCustomColors = (
147 type: 'light' | 'dark',

Callers 1

DynamicColorThemeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…