(hue: number)
| 61 | * Returns the hue value normalized to the range of 0 to 360. |
| 62 | */ |
| 63 | export 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. |
| 72 | const ORANGE_LIGHTNESS_THRESHOLD = 0.68; |