Reload theme in Makie

Hello,

I am trying to make a simple GUI using Makie.jl.
I would like to allow users to change themes by pressing a button.

I found that the following code doesn’t work:
set_theme!(theme_light())
while that snippet works:
figure.scene.backgroundcolor[] = styles.darkmode.background

The problem with the second version is that I don’t really know which properties should be updated and I would really appreciate the first approach working in the statefull app (Figure is stored in memory).

Thanks in advance!

Changing the theme does not change figures made previously, as that would create too many observable backreferences. And you can’t know which values were previously set by you vs copied from an older theme, so it isn’t possible to fully automatically apply a new theme to an existing figure without overwriting everything.

You should be able though to pass specific theme observables into the Figure constructor and update those.

Thanks a lot for your help, I should ask earlier :sweat_smile: