contrastRegionPath
Returns the longest contour path (most points) of contrastRegionPaths, or [] when the region is empty.
import { contrastRegionPath } from '@pbroom/color-kit';region.ts:86function contrastRegionPath(
reference: Color,
hue: number,
options?: ContrastRegionPathOptions,
trace?: InternalPlaneTraceContext | null,
): ContrastRegionPoint[];Takes the same arguments and throws under the same conditions as contrastRegionPaths.
Parameters
- hue
number - OKLCH hue in degrees (wrapped).
- options?
ContrastRegionPathOptionsdefault{} - Gamut, metric, threshold and sampling options.
- trace?
InternalPlaneTraceContext | null - Internal tracing context used by the plane query layer; omit it.
Returns
ContrastRegionPoint[]One contour path of { l, c } points.
Example
import { contrastRegionPath, parse } from '@pbroom/color-kit';
const path = contrastRegionPath(parse('#fff'), 250); // AA (4.5:1) vs white
path.length; // → 57
path[0]; // → { l: ≈ 0.5681, c: 0 }