@pbroom/color-kit/driverColor input

getColorInputLabel

Returns the English accessible label for a channel input, e.g. 'OKLCH lightness', 'Red' or 'Opacity'.

functionimport { getColorInputLabel } from '@pbroom/color-kit/driver';color-input.ts:380
function getColorInputLabel<Model extends ColorInputModel>(
  model: Model,
  channel: ColorInputChannelFor<Model>,
): string;

Parameters

modelModel

Returns

string

Throws

  • When channel does not belong to model.

Example

TypeScript
import { getColorInputLabel } from '@pbroom/color-kit/driver';

getColorInputLabel('oklch', 'c'); // → 'OKLCH chroma'
getColorInputLabel('hsl', 's'); // → 'Saturation'