@pbroom/color-kit/driverColor input
resolveColorInputSteps
Resolves the step sizes for a channel input: each option that is a finite positive number wins, anything else falls back to the channel default.
import { resolveColorInputSteps } from '@pbroom/color-kit/driver';color-input.ts:347function resolveColorInputSteps<Model extends ColorInputModel>(
model: Model,
channel: ColorInputChannelFor<Model>,
options?: ResolveColorInputStepsOptions,
): ColorInputStepConfig;Parameters
- model
Model - channel
ColorInputChannelFor<Model> - options?
ResolveColorInputStepsOptionsdefault{}
Returns
Throws
- When
channeldoes not belong tomodel.
Example
import { resolveColorInputSteps } from '@pbroom/color-kit/driver';
resolveColorInputSteps('oklch', 'h');
// → { step: 1, fineStep: 0.1, coarseStep: 10, pageStep: 45 }
resolveColorInputSteps('rgb', 'r', { step: 5, pageStep: -1 });
// → { step: 5, fineStep: 0.1, coarseStep: 10, pageStep: 25 }See also
ResolveColorInputStepsOptions for the per-channel defaults.