(key: string, index: number)
| 93 | }; |
| 94 | |
| 95 | const getColorForDataKey = (key: string, index: number): string => { |
| 96 | if (settings.colorScheme === "custom" && settings.customColors.length > 0) { |
| 97 | return settings.customColors[index % settings.customColors.length]; |
| 98 | } |
| 99 | |
| 100 | if (settings.colorScheme === "preset") { |
| 101 | const preset = THEME_PRESETS.find((p) => p.id === settings.themePreset); |
| 102 | if (preset) { |
| 103 | return preset.colors[index % preset.colors.length]; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | // Default colors |
| 108 | const defaultColors = [ |
| 109 | "hsl(var(--chart-1))", |
| 110 | "hsl(var(--chart-2))", |
| 111 | "hsl(var(--chart-3))", |
| 112 | "hsl(var(--chart-4))", |
| 113 | "hsl(var(--chart-5))", |
| 114 | ]; |
| 115 | return defaultColors[index % defaultColors.length]; |
| 116 | }; |
| 117 | |
| 118 | const applyThemeOrderToCustom = () => { |
| 119 | const preset = |
no test coverage detected