@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.

functionimport { resolveColorInputSteps } from '@pbroom/color-kit/driver';color-input.ts:347
function resolveColorInputSteps<Model extends ColorInputModel>(
  model: Model,
  channel: ColorInputChannelFor<Model>,
  options?: ResolveColorInputStepsOptions,
): ColorInputStepConfig;

Parameters

modelModel

Returns

ColorInputStepConfig

Throws

  • When channel does not belong to model.

Example

TypeScript
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.