utilities_colors.js

// JS mirrors of key CSS color variables for canvas draws.
// Read once on load, refreshed on theme change via 'themechange' event (theme.js).
export let ACCENT_STRONG;

/** Updates exported color variables from current CSS custom properties. */
function updateColors() {
    const style = getComputedStyle(document.documentElement);
    ACCENT_STRONG = style.getPropertyValue('--accent-strong').trim();
}

updateColors();
window.addEventListener('themechange', updateColors);