@pbroom/color-kitHarmony

complementary

Return the complementary color: the OKLCH hue rotated 180°, with lightness, chroma and alpha unchanged. Not gamut mapped.

functionimport { complementary } from '@pbroom/color-kit';index.ts:28
function complementary(color: Color): Color;

Parameters

colorColor
Base color

Returns

ColorA new Color

Example

TypeScript
import { complementary, parse } from '@pbroom/color-kit';

complementary(parse('oklch(0.7 0.15 30)')); // → { l: 0.7, c: 0.15, h: 210, alpha: 1 }

See also