@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).

functionimport { getColorAreaChromaBandPoints } from '@pbroom/color-kit/driver';color-area.ts:640
function getColorAreaChromaBandPoints(
  reference: Color,
  hue: number,
  axes: ResolvedColorAreaAxes,
  options?: ColorAreaChromaBandOptions,
): ColorAreaGamutBoundaryPoint[];

Parameters

referenceColor
Supplies the requested chroma, and the default selectedLightness and alpha.
huenumber
OKLCH hue of the band, in degrees.

Returns

ColorAreaGamutBoundaryPoint[]

Throws

  • When options.gamut is not 'srgb' or 'display-p3' (for example the removed 'p3' spelling).

Example

TypeScript
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 }

See also