@pbroom/color-kitManipulation

adjustHue

Rotate the OKLCH hue by degrees (positive or negative), wrapping into [0, 360). Lightness, chroma and alpha are unchanged.

functionimport { adjustHue } from '@pbroom/color-kit';index.ts:137
function adjustHue(  color: Color, ,  degrees: number,): Color;

Parameters

colorColor
Color to rotate
degreesnumber
Hue offset in degrees

Returns

ColorA new Color

Example

TypeScript
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 }

See also