Add more color variations

This commit is contained in:
Joey Yakimowich-Payne 2026-01-19 15:33:42 -07:00
commit d6fa339755
No known key found for this signature in database
GPG key ID: DDF6AF5B21B407D4
2 changed files with 152 additions and 14 deletions

View file

@ -101,17 +101,13 @@ export const getPlayerRank = (playerId: string, players: Player[]): number => {
return sorted.findIndex(p => p.id === playerId) + 1;
};
export const PLAYER_COLORS = [
'#2563eb',
'#e21b3c',
'#26890c',
'#ffa602',
'#d89e00',
'#0aa3a3',
'#b8008a',
'#6a4c93',
'#ff6b6b',
'#4ecdc4',
'#45b7d1',
'#8b5cf6',
];
const GOLDEN_RATIO = 0.618033988749895;
export const generatePlayerColor = (index: number): string => {
const hue = ((index * GOLDEN_RATIO) % 1) * 360;
const saturation = 70 + (index % 3) * 10;
const lightness = 45 + (index % 2) * 10;
return `hsl(${Math.round(hue)}, ${saturation}%, ${lightness}%)`;
};
export const PLAYER_COLORS = Array.from({ length: 50 }, (_, i) => generatePlayerColor(i));