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

Function roundToStep

packages/react-stately/src/color/useColorWheelState.ts:77–79  ·  view source on GitHub ↗
(value: number, step: number)

Source from the content-addressed store, hash-verified

75const DEFAULT_COLOR = parseColor('hsl(0, 100%, 50%)');
76
77function roundToStep(value: number, step: number): number {
78 return Math.round(value / step) * step;
79}
80
81function mod(n: number, m: number) {
82 return ((n % m) + m) % m;

Callers 3

setHueFunction · 0.85
incrementFunction · 0.85
decrementFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected