@pbroom/color-kit/driverColor area
getColorAreaChromaBandPoints
Samples the tonal strip at reference.c across lightness for hue degrees, kept inside the gamut (see mode), as area points ordered from l = 0 to l = 1 (y down). Returns [] unless the axes are lightness and chroma (in either orientation).
import { getColorAreaChromaBandPoints } from '@pbroom/color-kit/driver';color-area.ts:640function getColorAreaChromaBandPoints(
reference: Color,
hue: number,
axes: ResolvedColorAreaAxes,
options?: ColorAreaChromaBandOptions,
): ColorAreaGamutBoundaryPoint[];Parameters
- hue
number - OKLCH hue of the band, in degrees.
- options?
ColorAreaChromaBandOptionsdefault{}
Returns
Throws
- When
options.gamutis not'srgb'or'display-p3'(for example the removed'p3'spelling).
Example
import { getColorAreaChromaBandPoints, resolveColorAreaAxes } from '@pbroom/color-kit/driver';
const color = { l: 0.6, c: 0.1, h: 250, alpha: 1 };
const band = getColorAreaChromaBandPoints(color, color.h, resolveColorAreaAxes());
band.length; // → 13
band[6]; // → { l: 0.5, c: 0.1, x: 0.5, y: 0.75 }