refactor: update nutrition chart colors and enhance layout
Deploy Development / deploy (push) Successful in 47s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s

- Changed color codes for macro nutrients in the nutrition interpretation and metrics files to improve visual consistency.
- Added new CSS styles for uniform chart height and layout adjustments in the frontend components, enhancing the overall user experience.
- Refactored the NutritionCharts component to utilize the new macro chart theme for better maintainability and readability.
This commit is contained in:
Lars committed 2026-04-19 17:28:41 +02:00
1 parent b96b1931db
commit 31fbf33031
7 files changed
+131 -59

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
/**
* Einheitliche Makro-Farben für Verlauf (Balken, Donut, E3).
* Reihenfolge gestapelter Balken (Recharts, unten zuerst): Protein → Fett → Kohlenhydrate.
*/
export const MACRO_CHART = {
protein: '#4a8f72',
fat: '#6e8eb8',
carbs: '#c17d45',
}
/** Einheitliche Höhe Donut-Bereich / E3-Balken (Verlauf) */
export const NUTRITION_MACRO_CHART_BLOCK_PX = 260
/** Farbe nach Segment-Name (Protein / KH / Fett / englische Keys). */
export function macroFillByName(name) {
const n = String(name || '').toLowerCase()
if (n.includes('protein') || n === 'p') return MACRO_CHART.protein
if (n.includes('fett') || n.includes('fat')) return MACRO_CHART.fat
if (n.includes('kh') || n.includes('kohlenhydrat') || n.includes('carb')) return MACRO_CHART.carbs
return MACRO_CHART.carbs
}