normalizeHue
Wrap a hue in degrees into [0, 360). Negative and multi-turn values are accepted.
import { normalizeHue } from '@pbroom/color-kit';index.ts:72function normalizeHue(hue: number): number;Parameters
- hue
number - Hue in degrees
Returns
numberThe equivalent hue in [0, 360)
Example
import { normalizeHue } from '@pbroom/color-kit';
normalizeHue(-30); // → 330
normalizeHue(370); // → 10