@pbroom/color-kit/driverColor input

ParseColorInputExpressionOptions

Options for parseColorInputExpression.

interfaceimport type { ParseColorInputExpressionOptions } from '@pbroom/color-kit/driver';color-input-parser.ts:2
interface ParseColorInputExpressionOptions {
  currentValue: number;
  range: [number, number];
  allowExpressions?: 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.