@pbroom/color-kitHarmony

triadic

Return triadic colors (three hues 120° apart on the OKLCH wheel): [color, hue + 120, hue + 240]. Only the hue changes, and the results are not gamut mapped.

functionimport { triadic } from '@pbroom/color-kit';index.ts:67
function triadic(color: Color): Color[];

Parameters

colorColor
Base color (returned as the first entry)

Returns

Color[]Three colors

Example

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

triadic(parse('oklch(0.7 0.15 30)')).map((c) => c.h); // → [30, 150, 270]