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

Function prepareElevations

docs/src/utils/themes.tsx:100–115  ·  view source on GitHub ↗
(argbTheme: ARGBTheme)

Source from the content-addressed store, hash-verified

98};
99
100const prepareElevations = (argbTheme: ARGBTheme) => {
101 let elevations: Record<string, string> = {
102 level0: 'transparent',
103 };
104
105 const { primary, surface } = argbTheme;
106
107 for (let i = 0; i < elevationLevels.length; i++) {
108 elevations[`level${i + 1}`] = Color(surface)
109 .mix(Color(primary), Number(elevationLevels[i]))
110 .rgb()
111 .string();
112 }
113
114 return elevations;
115};
116
117export const getPreviewColors = (theme: Record<string, any>) => {
118 const preview = { ...theme };

Callers 1

prepareVariantFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…