// The six physical standee colors, in colorIndex order. import type { GameView } from "@wizwar/engine"; export const PLAYER_COLORS = ["#1a9c46", "#d3352b", "#c9308f", "#3a3ac0", "#2ab0c9", "#c9a72a"]; 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]!; }