@pbroom/color-kitHarmony

tetradic

Return tetradic (square) colors: four hues 90° apart on the OKLCH wheel, [color, hue + 90, hue + 180, hue + 270]. Only the hue changes, and the results are not gamut mapped.

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

Parameters

colorColor
Base color (returned as the first entry)

Returns

Color[]Four colors

Example

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

tetradic(parse('oklch(0.7 0.15 30)')).map((c) => c.h); // → [30, 120, 210, 300]