@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.
import { getColorInputChangedChannel } from '@pbroom/color-kit/driver';color-input.ts:444function getColorInputChangedChannel<Model extends ColorInputModel>(
model: Model,
channel: ColorInputChannelFor<Model>,
): 'alpha' | 'l' | 'c' | 'h' | undefined;Parameters
- model
Model - channel
ColorInputChannelFor<Model>
Returns
'alpha' | 'l' | 'c' | 'h' | undefined
Example
import { getColorInputChangedChannel } from '@pbroom/color-kit/driver';
getColorInputChangedChannel('oklch', 'h'); // → 'h'
getColorInputChangedChannel('rgb', 'r'); // → undefined