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

Function getColorScale

packages/dev/s2-docs/src/color.macro.ts:7–16  ·  view source on GitHub ↗
(
  this: MacroContext | void,
  name: string,
  size: any = 20
)

Source from the content-addressed store, hash-verified

5import * as tokens from '@adobe/spectrum-tokens/dist/json/variables.json';
6
7export function getColorScale(
8 this: MacroContext | void,
9 name: string,
10 size: any = 20
11): [string, string][] {
12 return Object.keys(colorScale(name)).map(k => [
13 k,
14 colorSwatch.call(this, k, 'backgroundColor', size)
15 ]);
16}
17
18export function colorSwatch(
19 this: MacroContext | void,

Callers 4

ColorScalesFunction · 0.90
SemanticColorsDisclosureFunction · 0.90
GlobalColorsDisclosureFunction · 0.90

Calls 1

colorScaleFunction · 0.90

Tested by

no test coverage detected