GamutBoundaryPathOptions
Options for gamutBoundaryPath: the MaxChromaAtOptions search settings plus sampling controls.
import type { GamutBoundaryPathOptions } from '@pbroom/color-kit';types.ts:120interface GamutBoundaryPathOptions extends MaxChromaAtOptions {
gamut?: GamutTarget;
tolerance?: number;
maxIterations?: number;
maxChroma?: number;
alpha?: number;
steps?: number;
simplifyTolerance?: number;
samplingMode?: 'uniform' | 'adaptive';
adaptiveTolerance?: number;
adaptiveMaxDepth?: number;
}Properties
- gamut?
GamutTargetdefault'srgb' - Target gamut.
- tolerance?
numberdefault0.0001 - Width of the bisection interval at which the search stops; the result can be up to this much below the true boundary chroma. Lower values increase precision and work per call. Non-positive values use the default.
- maxIterations?
numberdefault30 - Hard cap on bisection iterations. Non-finite or non-positive values use the default.
- maxChroma?
numberdefault0.4 - Upper chroma search bound. If a color at this chroma is already in gamut, it is returned as is, so this also acts as a chroma cap.
- alpha?
numberdefault1 - Alpha channel used while sampling.
- steps?
numberdefault100 - Number of equal lightness segments to sample (integer >= 2). The returned path has
steps + 1points. Ignored whensamplingModeis'adaptive'. - simplifyTolerance?
number - If set, run Ramer-Douglas-Peucker simplification after sampling. Tolerance is in normalized (l, c) space; e.g. 0.001–0.002. Omit or 0 to disable.
- samplingMode?
'uniform' | 'adaptive'default'uniform' 'uniform': fixed steps over lightness.'adaptive': anchors at the hue cusp and recursive midpoint refinement where curvature exceedsadaptiveTolerance.- adaptiveTolerance?
numberdefault0.001 - Max perpendicular error in (l, c) before subdividing in adaptive mode. Non-positive values use the default.
- adaptiveMaxDepth?
numberdefault12 - Max recursion depth in adaptive mode to avoid runaway (integer, capped at 20). Non-integer or non-positive values use the default.