napari: switching themes causes incomplete updates
š Bug
The ālightā theme for napari is looking pretty terrible these days:

We should update it and make sure that any PRs that touch the UI are tested with both themes.
Also worth noting that the base layer needs to have blending mode ātranslucentā ā with additive, you get a totally white canvas. Perhaps itās a chance to play with inverted LUTs or something, not sure.
Finally, Iām not sure whether there is a way to set the theme globally. I could set it on a Viewer instance, but I could not set it on the napari.Viewer
class. It seems to me that it should be more of a global than an instance setting.
To Reproduce
Steps to reproduce the behavior:
import napari
v = napari.Viewer()
v.theme = 'light'
This crashes:
import napari
napari.Viewer.theme = 'light'
v = napari.Viewer()
This makes sense because it replaces a property with a text string! But I couldnāt find how else to set the theme.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 22 (21 by maintainers)
yeah, itās the switching. If I hard-code in the theme it looks fine, and hereās what it looks like when I switch back (inverted problem from above). so that should help narrow it down
note also: that the console button switched back to the darktheme after I clicked on it⦠but the other control buttons did not switch upon clicking
hereās a different mac, this one a macbook pro on mojave. Interestingly, this one didnāt even try in the controls area. Strange that weāre seeing more than just 2 phenotypes!
@sofroniewn please note the problem above. If someone uses code where all the layers have blending mode āadditiveā (as
channel_axis=n
does), then the image is just all white if the canvas is white. Thatās a problem.Regarding the platform dependence: Iām on Catalina, are you? And, can you try with a fresh install from pip? (I am trying it now, but am on a crappy connection so it might take me a while.)
I think black background is more comfortable as white could possibly interfere with image edges or with some other layers. Not a big deal but just to me black background by default makes more sense.
Discussing here is good @AhmetCanSolak. Iām completely open to that, and itās easy to change, but curious why do you think black is a better canvas background for both themes? I guess it might be more consistent, but I though it looked nicer to have a white background with the light theme. @jni were you suggesting this too? I think @alexdesiqueira was someone who was excited about the light theme if I remember correctly š so curious what they prefer
@jni theme looks fine on my mac so this might be something cross platform š¦
@marciovm weāve had comments from people who prefer
light
todark
. The way weāve set it up should make it pretty easy to maintain both - we have color palettes and style using the palettes, but something funky seems to be happening above š¦