MCPcopy Create free account
hub / github.com/adobe/react-spectrum / colorScale

Function colorScale

scripts/mapStaticColors.mjs:89–98  ·  view source on GitHub ↗
(scale)

Source from the content-addressed store, hash-verified

87}
88
89function colorScale(scale) {
90 let res = {};
91 let re = new RegExp(`^${scale}-\\d+$`);
92 for (let token in tokens) {
93 if (re.test(token)) {
94 res[token.replace('-color', '')] = colorToken(tokens[token]);
95 }
96 }
97 return res;
98}
99
100const s2Colors = {
101 ...colorScale('gray'),

Callers 1

Calls 1

colorTokenFunction · 0.70

Tested by

no test coverage detected