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

Function getColorSpaceAxes

packages/react-stately/src/color/Color.ts:130–137  ·  view source on GitHub ↗
(xyChannels: {xChannel?: ColorChannel; yChannel?: ColorChannel})

Source from the content-addressed store, hash-verified

128 abstract getColorSpace(): ColorSpace;
129
130 getColorSpaceAxes(xyChannels: {xChannel?: ColorChannel; yChannel?: ColorChannel}): ColorAxes {
131 let {xChannel, yChannel} = xyChannels;
132 let xCh = xChannel || this.getColorChannels().find(c => c !== yChannel)!;
133 let yCh = yChannel || this.getColorChannels().find(c => c !== xCh)!;
134 let zCh = this.getColorChannels().find(c => c !== xCh && c !== yCh)!;
135
136 return {xChannel: xCh, yChannel: yCh, zChannel: zCh};
137 }
138
139 abstract getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
140

Callers

nothing calls this directly

Calls 1

getColorChannelsMethod · 0.65

Tested by

no test coverage detected