Skip to main content

Module palette

Module palette 

Source
Expand description

The shared identity palette for panes, agents, window tabs and browser profiles: 12 hues, then Black and White (docs/specs/SPEC_SHARED_PALETTE_12_HUES_BLACK_WHITE_2026_11_16.md).

The list lives once, in schema/color-palette.json; the frontend imports the same file (frontend/app/theme/palette.ts), so the two cannot drift. A slot is a hue or a neutral. This side only ever needs the slot’s stored #rrggbb (what an agent, a window tab or a profile keeps) and which slot an older colour means; the per-role tones are the frontend’s (pane-color-scheme.ts).

Structs§

Slot

Enums§

Neutral
Black or White: a slot with no hue.

Functions§

farthest_free_slot
The slot for a new browser profile: the least-used hue, then the one farthest in hue from the hues already used, then the lowest. Never Black or White.
hue_distance
Circular distance between two hues, degrees, 0 to 180.
oklch_hue
The OKLCH hue, in degrees 0 to 360, of a #rrggbb; None for anything else. A grey has no hue worth snapping by: snap_hex reads it as Black or White.
pick_slot
The slot for a new agent: the least-used hue among taken (the stored colours of the agents that exist), ties broken by walking forward from the FNV-1a slot of the agent id, so the same id and the same set always give the same colour. With nothing taken it is the plain hash. Never Black or White: a neutral is only ever someone’s own choice.
slot_by_id
The slot with this id. An id retired with the 16 (crimson, azure, …) gives the slot it became.
slots
The 14 slots: the 12 hues in hue order, then Black and White.
snap_hex
The slot a stored #rrggbb stands for (any colour: a slot’s own hex, one of the 16’s, an old Tailwind hex, an HSL pick). One of the 16’s own hexes goes where the retired table says: its hue alone does not settle it (Indigo sits midway between Blue and Violet). A grey is Black or White; any other colour is the hue slot nearest in OKLCH hue. None when it is not a colour.