gamutBoundaryPath
Samples the OKLCH lightness/chroma gamut boundary at a fixed hue, from black (l: 0) to white (l: 1).
import { gamutBoundaryPath } from '@pbroom/color-kit';boundary-path.ts:51function gamutBoundaryPath(
hue: number,
options?: GamutBoundaryPathOptions,
): GamutBoundaryPoint[];Each point's c is maxChromaAt at that lightness. In 'uniform' mode (the default) the path has steps + 1 evenly spaced points; in 'adaptive' mode points are added around the hue cusp and where the boundary bends. Output is deterministic and usable for SVG/Canvas overlay paths.
Parameters
- hue
number - OKLCH hue in degrees.
- options?
GamutBoundaryPathOptionsdefault{} - Gamut, sampling and search options.
Returns
GamutBoundaryPoint[]Boundary points ordered by increasing lightness.
Throws
- When
options.gamutis not'srgb'or'display-p3'. - When
stepsis not an integer >= 2 (uniform mode).
Example
import { gamutBoundaryPath } from '@pbroom/color-kit';
gamutBoundaryPath(250, { steps: 4 });
// → [
// { l: 0, c: 0 },
// { l: 0.25, c: 0.070703125 },
// { l: 0.5, c: 0.14150390625 },
// { l: 0.75, c: 0.13369140625 },
// { l: 1, c: 0 },
// ]