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

Function withChannelValue

packages/react-stately/src/color/Color.ts:112–120  ·  view source on GitHub ↗
(channel: ColorChannel, value: number)

Source from the content-addressed store, hash-verified

110 }
111
112 withChannelValue(channel: ColorChannel, value: number): IColor {
113 if (channel in this) {
114 let x = this.clone();
115 x[channel] = value;
116 return x;
117 }
118
119 throw new Error('Unsupported color channel: ' + channel);
120 }
121
122 getChannelName(channel: ColorChannel, locale: string) {
123 let strings =

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.65

Tested by

no test coverage detected