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

Function normalizeHue

packages/react-stately/src/color/Color.ts:63–69  ·  view source on GitHub ↗
(hue: number)

Source from the content-addressed store, hash-verified

61 * Returns the hue value normalized to the range of 0 to 360.
62 */
63export function normalizeHue(hue: number): number {
64 if (hue === 360) {
65 return hue;
66 }
67
68 return ((hue % 360) + 360) % 360;
69}
70
71// Lightness threshold between orange and brown.
72const ORANGE_LIGHTNESS_THRESHOLD = 0.68;

Callers 2

parseMethod · 0.85
parseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected