@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).
import { getColorAreaGamutBoundaryPoints } from '@pbroom/color-kit/driver';color-area.ts:529function getColorAreaGamutBoundaryPoints(
hue: number,
axes: ResolvedColorAreaAxes,
options?: ColorAreaGamutBoundaryOptions,
): ColorAreaGamutBoundaryPoint[];Parameters
- hue
number - options?
ColorAreaGamutBoundaryOptionsdefault{}
Returns
Throws
- When
options.gamutis not'srgb'or'display-p3'(for example the removed'p3'spelling). - When
options.stepsis not an integer of at least 2.
Example
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 }