@pbroom/color-kit/driverColor input

getColorInputChangedChannel

Maps an input's channel to the OKLCH ColorChannel reported as changedChannel in ColorUpdateEvent. Only OKLCH inputs map to a channel; RGB and HSL edits change several OKLCH channels at once and return undefined.

functionimport { getColorInputChangedChannel } from '@pbroom/color-kit/driver';color-input.ts:444
function getColorInputChangedChannel<Model extends ColorInputModel>(
  model: Model,
  channel: ColorInputChannelFor<Model>,
): 'alpha' | 'l' | 'c' | 'h' | undefined;

Parameters

modelModel

Returns

'alpha' | 'l' | 'c' | 'h' | undefined

Example

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

getColorInputChangedChannel('oklch', 'h'); // → 'h'
getColorInputChangedChannel('rgb', 'r'); // → undefined