@pbroom/color-kit/driverMulti color
selectMultiColorEntry
Selects an entry. No-op for an unknown id or the already selected one.
import { selectMultiColorEntry } from '@pbroom/color-kit/driver';multi-color-state.ts:518function selectMultiColorEntry(
model: MultiColorModel,
id: string,
): MultiColorModel;Parameters
- id
string
Returns
Example
import { createMultiColorModel, selectMultiColorEntry } from '@pbroom/color-kit/driver';
const model = createMultiColorModel({ colors: { bg: '#ffffff', fg: '#3b82f6' } });
selectMultiColorEntry(model, 'fg').selectedId; // → 'fg'
selectMultiColorEntry(model, 'missing') === model; // → true