diff --git a/server/src/wled_controller/static/js/features/dashboard.js b/server/src/wled_controller/static/js/features/dashboard.js index d721bcc..c62c523 100644 --- a/server/src/wled_controller/static/js/features/dashboard.js +++ b/server/src/wled_controller/static/js/features/dashboard.js @@ -814,6 +814,18 @@ document.addEventListener('languageChanged', () => { loadDashboard(); }); +// Update FPS chart colors when accent color changes +document.addEventListener('accentColorChanged', () => { + const accent = _getAccentColor(); + for (const chart of Object.values(_fpsCharts)) { + if (!chart) continue; + chart.data.datasets[0].borderColor = accent; + chart.data.datasets[0].backgroundColor = accent + '1f'; + chart.data.datasets[1].borderColor = accent + '80'; + chart.update(); + } +}); + // Pause uptime timer when browser tab is hidden, resume when visible document.addEventListener('visibilitychange', () => { if (document.hidden) { diff --git a/server/src/wled_controller/templates/index.html b/server/src/wled_controller/templates/index.html index 4d5014f..c1aba40 100644 --- a/server/src/wled_controller/templates/index.html +++ b/server/src/wled_controller/templates/index.html @@ -246,6 +246,7 @@ const native = document.getElementById('cp-native-accent'); if (native) native.value = hex; localStorage.setItem('accentColor', hex); + document.dispatchEvent(new CustomEvent('accentColorChanged', { detail: { color: hex } })); if (!silent) showToast('Accent color updated', 'info'); }