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

Function increment

packages/react-stately/src/color/useColorWheelState.ts:184–192  ·  view source on GitHub ↗
(stepSize = 1)

Source from the content-addressed store, hash-verified

182 return angleToCartesian(value.getChannelValue('hue'), radius);
183 },
184 increment(stepSize = 1) {
185 let s = Math.max(stepSize, step);
186 let newValue = hue + s;
187 if (newValue >= maxValueX) {
188 // Make sure you can always get back to 0.
189 newValue = minValueX;
190 }
191 setHue(roundToStep(mod(newValue, 360), s));
192 },
193 decrement(stepSize = 1) {
194 let s = Math.max(stepSize, step);
195 if (hue === 0) {

Callers

nothing calls this directly

Calls 3

setHueFunction · 0.85
roundToStepFunction · 0.85
modFunction · 0.70

Tested by

no test coverage detected