ChromaBandOptions
Options for chromaBand: the MaxChromaAtOptions search settings plus mode and sampling controls.
import type { ChromaBandOptions } from '@pbroom/color-kit';types.ts:166interface ChromaBandOptions extends MaxChromaAtOptions {
gamut?: GamutTarget;
tolerance?: number;
maxIterations?: number;
maxChroma?: number;
alpha?: number;
mode?: ChromaBandMode;
steps?: number;
samplingMode?: 'uniform' | 'adaptive';
adaptiveTolerance?: number;
adaptiveMaxDepth?: number;
selectedLightness?: 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.
- mode?
ChromaBandModedefault'clamped' - Chroma distribution strategy across the lightness sweep.
- steps?
numberdefault12 - Number of equal lightness segments to sample (integer >= 2). The returned band has
steps + 1colors. Ignored whensamplingModeis'adaptive'. - samplingMode?
'uniform' | 'adaptive'default'uniform' 'uniform': fixed lightness steps.'adaptive': reuse adaptive boundary sampling and project to chroma mode.- adaptiveTolerance?
numberdefault0.001 - Max perpendicular error in (l, c) before subdividing in adaptive mode.
- adaptiveMaxDepth?
numberdefault12 - Max recursion depth in adaptive mode to avoid runaway.
- selectedLightness?
numberdefault0.5 - Lightness anchor for proportional mode, clamped to 0-1. Used to resolve the requested/max chroma ratio.