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

Function getColorChannels

packages/react-stately/src/color/Color.ts:47–58  ·  view source on GitHub ↗
(
  colorSpace: ColorSpace
)

Source from the content-addressed store, hash-verified

45
46/** Returns a list of color channels for a given color space. */
47export function getColorChannels(
48 colorSpace: ColorSpace
49): [ColorChannel, ColorChannel, ColorChannel] {
50 switch (colorSpace) {
51 case 'rgb':
52 return RGBColor.colorChannels;
53 case 'hsl':
54 return HSLColor.colorChannels;
55 case 'hsb':
56 return HSBColor.colorChannels;
57 }
58}
59
60/**
61 * Returns the hue value normalized to the range of 0 to 360.

Callers 5

ColorPickerExampleRenderFunction · 0.90
ColorEditorFunction · 0.90
ChannelControlFunction · 0.90
ColorSpaceControlFunction · 0.90
ColorEditor.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected