@pbroom/color-kitHarmony

splitComplementary

Return split-complementary colors: the base color plus the two hues angle degrees either side of its complement, [color, hue + 180 - angle, hue + 180 + angle]. Only the hue changes, and the results are not gamut mapped.

functionimport { splitComplementary } from '@pbroom/color-kit';index.ts:113
function splitComplementary(  color: Color, ,  angle?: number,): Color[];

Parameters

colorColor
Base color (returned as the first entry)
angle?numberdefault 30
Offset from the complement in degrees (default 30)

Returns

Color[]Three colors

Example

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

splitComplementary(parse('oklch(0.7 0.15 30)')).map((c) => c.h); // → [30, 180, 240]

See also