@pbroom/color-kit/driverColor input

ResolveColorInputDraftValueOptions

Options for resolveColorInputDraftValue.

interfaceimport type { ResolveColorInputDraftValueOptions } from '@pbroom/color-kit/driver';color-input.ts:117
interface ResolveColorInputDraftValueOptions extends ParseColorInputExpressionOptions {
  currentValue: number;
  range: [number, number];
  allowExpressions?: boolean;
  wrap?: boolean;
}

Properties

currentValuenumber
Current channel value: the left operand when an expression starts with an operator (+10, *2).
range[number, number]
Channel range [min, max]. An absolute % number is a position in it (range[0] + p * span); a relative one is a fraction of its span.
allowExpressions?booleandefault false
Accept arithmetic (+ - * /, parentheses) and relative input. When false, only a single number is accepted.
wrap?booleandefault false
Wrap the parsed value into range (hue-style) instead of clamping it.