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

Function setXValue

packages/react-stately/src/color/useColorAreaState.ts:155–161  ·  view source on GitHub ↗
(v: number)

Source from the content-addressed store, hash-verified

153 let xValue = color.getChannelValue(channels.xChannel);
154 let yValue = color.getChannelValue(channels.yChannel);
155 let setXValue = (v: number) => {
156 if (v === xValue) {
157 return;
158 }
159 let newColor = color.withChannelValue(channels.xChannel, v);
160 setColor(newColor);
161 };
162 let setYValue = (v: number) => {
163 if (v === yValue) {
164 return;

Callers 2

incrementXFunction · 0.85
decrementXFunction · 0.85

Calls 2

withChannelValueMethod · 0.80
setColorFunction · 0.70

Tested by

no test coverage detected