export const HUD_ACCENT_THEMES = Object.freeze([
  { name: "cyan", code: 81, mood: "LazyClaude default" },
  { name: "blue", code: 39, mood: "electric blue" },
  { name: "teal", code: 49, mood: "bright teal" },
  { name: "green", code: 118, mood: "neon green" },
  { name: "lavender", code: 177, mood: "bright violet" },
  { name: "rose", code: 198, mood: "hot pink" },
  { name: "gold", code: 220, mood: "signal amber" },
  { name: "orange", code: 208, mood: "vivid orange" },
  { name: "slate", code: 75, mood: "ice blue" },
  { name: "gray", code: 231, mood: "bright white" },
]);

const accentNames = new Set(HUD_ACCENT_THEMES.map((theme) => theme.name));

export const normalizeHudAccent = (value) => {
  const normalized = String(value || "").trim().toLowerCase();
  return accentNames.has(normalized) ? normalized : "cyan";
};

export const themeForAccent = (value) => {
  const normalized = normalizeHudAccent(value);
  return HUD_ACCENT_THEMES.find((theme) => theme.name === normalized) ?? HUD_ACCENT_THEMES[0];
};

export const accentCodeForName = (value) => themeForAccent(value).code;
