(count: number, max: number)
| 18 | } |
| 19 | |
| 20 | function getColor(count: number, max: number): string { |
| 21 | if (count === 0) return "rgba(255,255,255,0.04)"; |
| 22 | const ratio = count / Math.max(max, 1); |
| 23 | if (ratio < 0.25) return "rgba(255, 59, 48, 0.2)"; |
| 24 | if (ratio < 0.5) return "rgba(255, 59, 48, 0.4)"; |
| 25 | if (ratio < 0.75) return "rgba(255, 59, 48, 0.65)"; |
| 26 | return "rgba(255, 59, 48, 0.9)"; |
| 27 | } |
| 28 | |
| 29 | export function ActivityHeatmap() { |
| 30 | const [stats, setStats] = useState<HeatmapStats | null>(null); |