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

Function decrement

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

Source from the content-addressed store, hash-verified

191 setHue(roundToStep(mod(newValue, 360), s));
192 },
193 decrement(stepSize = 1) {
194 let s = Math.max(stepSize, step);
195 if (hue === 0) {
196 // We can't just subtract step because this might be the case:
197 // |(previous step) - 0| < step size
198 setHue(roundDown(360 / s) * s);
199 } else {
200 setHue(roundToStep(mod(hue - s, 360), s));
201 }
202 },
203 setDragging(isDragging) {
204 let wasDragging = isDraggingRef.current;
205 isDraggingRef.current = isDragging;

Callers

nothing calls this directly

Calls 4

setHueFunction · 0.85
roundDownFunction · 0.85
roundToStepFunction · 0.85
modFunction · 0.70

Tested by

no test coverage detected