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

Function normalizeColor

packages/react-stately/src/color/Color.ts:38–44  ·  view source on GitHub ↗
(v: string | IColor)

Source from the content-addressed store, hash-verified

36}
37
38export function normalizeColor(v: string | IColor): IColor {
39 if (typeof v === 'string') {
40 return parseColor(v);
41 } else {
42 return v;
43 }
44}
45
46/** Returns a list of color channels for a given color space. */
47export function getColorChannels(

Callers 6

useColorSliderStateFunction · 0.90
setValueFunction · 0.90
useColorAreaStateFunction · 0.90
setValueFunction · 0.90
useColorWheelStateFunction · 0.90
setValueFunction · 0.90

Calls 1

parseColorFunction · 0.85

Tested by

no test coverage detected