@pbroom/color-kit/driverColor area

getColorAreaGamutBoundaryPoints

Traces the gamut boundary (max in-gamut chroma per lightness) at hue degrees as area points, ordered from l = 0 to l = 1. Each point carries its OKLCH l/c and normalized x/y (y down). Returns [] unless the axes are lightness and chroma (in either orientation).

functionimport { getColorAreaGamutBoundaryPoints } from '@pbroom/color-kit/driver';color-area.ts:529
function getColorAreaGamutBoundaryPoints(
  hue: number,
  axes: ResolvedColorAreaAxes,
  options?: ColorAreaGamutBoundaryOptions,
): ColorAreaGamutBoundaryPoint[];

Parameters

huenumber

Returns

ColorAreaGamutBoundaryPoint[]

Throws

  • When options.gamut is not 'srgb' or 'display-p3' (for example the removed 'p3' spelling).
  • When options.steps is not an integer of at least 2.

Example

TypeScript
import { getColorAreaGamutBoundaryPoints, resolveColorAreaAxes } from '@pbroom/color-kit/driver';

const points = getColorAreaGamutBoundaryPoints(250, resolveColorAreaAxes());
points.length; // → 101
points[10]; // → { l: 0.1, c: 0.02841796875, x: 0.1, y: 0.928955078125 }

See also