Subscribe to theme changes and invoke the callback with the new ThemeColors. Returns an unsubscribe function.
const unsub = onThemeChange((colors) => { chart.data.datasets[0].backgroundColor = colors.cyan; chart.update();}); Copy
const unsub = onThemeChange((colors) => { chart.data.datasets[0].backgroundColor = colors.cyan; chart.update();});
Subscribe to theme changes and invoke the callback with the new ThemeColors. Returns an unsubscribe function.