0.34.0: Übersicht mit Projektfarben, zweizeiligen Aufgaben und Geldfluss ohne Kontostand
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
10
src/domain/farbe.ts
Normal file
10
src/domain/farbe.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
// Projektfarben: eigene Farbe des Projekts, sonst reihum nach der Reihenfolge im Terminplan.
|
||||
// Terminplan, Handy und Übersicht nehmen dieselbe Farbe (Henning, 23.10.2026).
|
||||
export const FARBEN = ["#1d5fa8", "#2f6b5a", "#b7791f", "#a26e3a", "#805ad5", "#c53030", "#2c7a7b", "#97266d", "#4a5568", "#6b8e23"];
|
||||
|
||||
/** alle = Projekte des Terminplans in ihrer Reihenfolge; gezählt werden nur die nicht abgeschlossenen (wie der Terminplan ohne Filter), abgeschlossene sind grau */
|
||||
export function projektFarbe(p: { id: string; farbe?: string | null }, alle: { id: string; status?: string }[]): string {
|
||||
if (/^#[0-9a-f]{6}$/i.test(p.farbe ?? "")) return p.farbe!;
|
||||
const i = alle.filter((x) => x.status !== "abgeschlossen").findIndex((x) => x.id === p.id);
|
||||
return i < 0 ? "#718096" : FARBEN[i % FARBEN.length]!;
|
||||
}
|
||||
Reference in New Issue
Block a user