// The six physical standee colors, in colorIndex order. import type { GameView } from "@wizwar/engine"; // The yellow must stay unmistakably yellow on a washed-out laptop panel: // mustard drifts orange there and blurs into the red beside it. export const PLAYER_COLORS = ["#1a9c46", "#d3352b", "#c9308f", "#3a3ac0", "#2ab0c9", "#ecc716"]; export function colorIndexOf(view: GameView, id: string): number { const p = view.players.find((p) => p.id === id); return p?.colorIndex ?? Math.max(0, view.players.findIndex((q) => q.id === id)); } export function wizardColor(view: GameView, id: string): string { return PLAYER_COLORS[colorIndexOf(view, id) % PLAYER_COLORS.length]!; }