adjustHue
Rotate the OKLCH hue by degrees (positive or negative), wrapping into [0, 360). Lightness, chroma and alpha are unchanged.
import { adjustHue } from '@pbroom/color-kit';index.ts:137function adjustHue( color: Color, , degrees: number,): Color;Parameters
- degrees
number - Hue offset in degrees
Returns
ColorA new Color
Example
import { adjustHue, parse } from '@pbroom/color-kit';
adjustHue(parse('oklch(0.7 0.1 300)'), 90); // → { l: 0.7, c: 0.1, h: 30, alpha: 1 }