Initial commit - copied workspace after database cleanup
This commit is contained in:
52
dashboard/src/groupColors.ts
Normal file
52
dashboard/src/groupColors.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
// 20 gut unterscheidbare Farben für Gruppen
|
||||
|
||||
export const groupColorPalette: string[] = [
|
||||
'#1E90FF', // Blau
|
||||
'#28A745', // Grün
|
||||
'#FFC107', // Gelb
|
||||
'#DC3545', // Rot
|
||||
'#6F42C1', // Lila
|
||||
'#20C997', // Türkis
|
||||
'#FD7E14', // Orange
|
||||
'#6610F2', // Violett
|
||||
'#17A2B8', // Cyan
|
||||
'#E83E8C', // Pink
|
||||
'#FF5733', // Koralle
|
||||
'#2ECC40', // Hellgrün
|
||||
'#FFB300', // Dunkelgelb
|
||||
'#00796B', // Petrol
|
||||
'#C70039', // Dunkelrot
|
||||
'#8D6E63', // Braun
|
||||
'#607D8B', // Grau-Blau
|
||||
'#00B8D4', // Türkisblau
|
||||
'#FF6F00', // Dunkelorange
|
||||
'#9C27B0', // Dunkellila
|
||||
];
|
||||
|
||||
// Gibt für eine Gruppen-ID immer dieselbe Farbe zurück (Index basiert auf Gruppenliste)
|
||||
export function getGroupColor(groupId: string, groups: { id: string }[]): string {
|
||||
const colorPalette = [
|
||||
'#1E90FF',
|
||||
'#28A745',
|
||||
'#FFC107',
|
||||
'#DC3545',
|
||||
'#6F42C1',
|
||||
'#20C997',
|
||||
'#FD7E14',
|
||||
'#6610F2',
|
||||
'#17A2B8',
|
||||
'#E83E8C',
|
||||
'#FF5733',
|
||||
'#2ECC40',
|
||||
'#FFB300',
|
||||
'#00796B',
|
||||
'#C70039',
|
||||
'#8D6E63',
|
||||
'#607D8B',
|
||||
'#00B8D4',
|
||||
'#FF6F00',
|
||||
'#9C27B0',
|
||||
];
|
||||
const idx = groups.findIndex(g => g.id === groupId);
|
||||
return colorPalette[idx % colorPalette.length];
|
||||
}
|
||||
Reference in New Issue
Block a user