invert
Invert a color in OKLCH: lightness becomes 1 - l and the hue rotates 180°, while chroma and alpha are kept. This is a perceptual inversion, not an sRGB channel inversion, and the result is not gamut mapped.
import { invert } from '@pbroom/color-kit';index.ts:273function invert(color: Color): Color;Parameters
Returns
ColorA new Color
Example
import { invert, parse } from '@pbroom/color-kit';
invert(parse('oklch(0.3 0.1 30)')); // → { l: 0.7, c: 0.1, h: 210, alpha: 1 }