mirror of
https://github.com/gauvainboiche/ketapk.git
synced 2026-09-02 11:13:11 +02:00
feat: Adding color themes + .ignore files update
This commit is contained in:
@@ -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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user