Expand description
Snap the colours stored before the shared palette to their nearest slot
(docs/specs/SPEC_SHARED_PERCEPTUAL_PALETTE_16_2026_11_01.md §5.3, §7): the
agents’ ui:color (agent_content) and the browser profiles’ colours
(browser-profiles.json). Both were picked from older lists (14 Tailwind
hexes, 8 profile hexes, or an HSL pick), so they are not slot hexes yet;
the frontend already draws them in their nearest slot, and this makes the
stored value the slot’s own hex, which is what Kanban, the mobile app and
the “least-used colour” pick for new agents read.
A window tab’s tab:color and a pane’s frame:hue / pane:colors are
left as they are: they are read as their nearest slot and become slot
values the next time the user picks one.
The palette has since become 12 hues, Black and White; m0051_palette_12_snap
moves the stored colours again, with the functions below.
Like m0020, it attaches the global definition registry itself so it sees
agents that live only there. Idempotent: a value that is already a slot’s
hex is left alone (and keeps its updated_at).