// Stable per-session accent colour, used to map a sidebar row to the pane // showing that session (issue #33). Hash the session id into a fixed OKLCH // palette tuned to the maestro tokens; collisions are tolerated when there are // more open sessions than hues — the colour is a hint, not an identity. import type { Uuid } from "./types.js"; const PALETTE = [ "oklch(0.80 0.13 152)", // green (the house accent) "oklch(0.80 0.12 90)", // amber "oklch(0.76 0.13 30)", // coral "oklch(0.78 0.11 210)", // teal "oklch(0.74 0.13 265)", // blue "oklch(0.76 0.14 320)", // magenta "oklch(0.80 0.11 60)", // gold "oklch(0.78 0.12 185)", // cyan ]; export function sessionColor(id: Uuid): string { let h = 0; for (let i = 0; i < id.length; i++) h = (h * 31 + id.charCodeAt(i)) >>> 0; return PALETTE[h % PALETTE.length]; }