feat: Adding color themes + .ignore files update

This commit is contained in:
gauvainboiche
2026-08-29 15:09:50 +02:00
parent 257e187964
commit 786b87270c
16 changed files with 419 additions and 169 deletions
+14 -1
View File
@@ -1,8 +1,21 @@
import { CLINICAL_THRESHOLDS } from './pkCore.js';
import { t } from './i18n.js';
// Le texte des zones cliniques (zone.textHex) est calibré pour un fond sombre.
// Sur le thème clair, il faut un texte foncé pour rester lisible sur le même fond pastel.
const LIGHT_THEME_ZONE_TEXT = {
inactive: '#854d0e',
anti_hyperalgesic: '#3f6212',
analgesia: '#92400e',
psychedelic: '#9d174d',
emergence: '#075985',
narcosis: '#1e3a8a',
excessive: '#7f1d1d'
};
export function updateChartAnnotations(chart, mode, currentYMax) {
const thresholds = CLINICAL_THRESHOLDS[mode];
const theme = document.documentElement.getAttribute('data-theme') || 'dark';
const annotations = {};
thresholds.zones.forEach((zone, index) => {
@@ -18,7 +31,7 @@ export function updateChartAnnotations(chart, mode, currentYMax) {
label: {
display: true,
content: t(`zones.${zone.zoneKey}`),
color: zone.textHex,
color: theme === 'light' ? (LIGHT_THEME_ZONE_TEXT[zone.zoneKey] || '#1e293b') : zone.textHex,
font: { size: 11, weight: 'bold' },
position: 'center'
}