@pbroom/color-kitHarmony

analogous

Return analogous colors (neighbors on the OKLCH hue wheel): [hue - angle, color, hue + angle]. Only the hue changes, and the results are not gamut mapped.

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

Parameters

colorColor
Base color (returned as the middle entry)
angle?numberdefault 30
Hue offset in degrees (default 30)

Returns

Color[]Three colors

Example

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

analogous(parse('oklch(0.7 0.15 30)')).map((c) => c.h); // → [0, 30, 60]