Returns the active ThemeColors based on the current data-theme attribute
on <html>. When the attribute is absent (e.g. before the anti-flash
snippet runs), falls back to prefers-color-scheme — consistent with the
CSS @media (prefers-color-scheme: dark) default. Defaults to
DARK_THEME_COLORS only in SSR / test environments where document is
undefined; in a browser without matchMedia support it defaults to
LIGHT_THEME_COLORS (matching the CSS :root base styles).
Call this wherever Chart.js datasets need the current palette, e.g.:
Returns the active ThemeColors based on the current
data-themeattribute on<html>. When the attribute is absent (e.g. before the anti-flash snippet runs), falls back toprefers-color-scheme— consistent with the CSS@media (prefers-color-scheme: dark)default. Defaults toDARK_THEME_COLORSonly in SSR / test environments wheredocumentis undefined; in a browser withoutmatchMediasupport it defaults toLIGHT_THEME_COLORS(matching the CSS:rootbase styles).Call this wherever Chart.js datasets need the current palette, e.g.: