Mustard #c9a72a drifted orange on washed-out screens and blurred into the red beside it in rings, dots, and names. #ecc716 stays yellow on any panel. The accent gold elsewhere keeps the house tone — it never stands next to a player's red. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015RCWSTnb1KYTPyL4GmhGnF
16 lines
687 B
TypeScript
16 lines
687 B
TypeScript
// 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]!;
|
|
}
|