@pbroom/color-kit/driverMulti color
setMultiColorActiveView
Switches the shared view model and sets every entry's source to source. No-op when the view is unchanged, whatever source is.
import { setMultiColorActiveView } from '@pbroom/color-kit/driver';multi-color-state.ts:492function setMultiColorActiveView(
model: MultiColorModel,
view: ViewModel,
source: ColorSource,
): MultiColorModel;Parameters
Returns
Example
import {
createMultiColorModel,
setMultiColorActiveView,
} from '@pbroom/color-kit/driver';
const model = createMultiColorModel({ colors: { bg: '#ffffff', fg: '#3b82f6' } });
const next = setMultiColorActiveView(model, 'hsl', 'user');
next.activeView; // → 'hsl'
next.entries.bg.source; // → 'user'