napari: switching themes causes incomplete updates

šŸ› Bug

The ā€˜light’ theme for napari is looking pretty terrible these days:

Screen Shot 2019-11-09 at 8 58 44 pm

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)

Most upvoted comments

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

Screen Shot 2019-11-11 at 5 08 35 PM

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!

Screen Shot 2019-11-11 at 4 47 24 PM Screen Shot 2019-11-11 at 4 47 49 PM
napari, 0.2.4+12.g6c5bb037
Qt, 5.13.1
NumPy, 1.17.3
SciPy, 1.3.1
VisPy, 0.6.1
scikit-image, 0.16.2

Platform: Darwin-18.7.0-x86_64-i386-64bit
Python:   3.7.3 | packaged by conda-forge | 
   (default, Jul  1 2019, 14:38:56)  [Clang 4.0.1 (tags/RELEASE_401/final)]
Backend:  PySide2
GL version:  '2.1 NVIDIA-12.0.24 355.11.10.50.10.103'
MAX_TEXTURE_SIZE: 16384

@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 😦

Screen Shot 2019-11-11 at 8 17 39 AM

@marciovm we’ve had comments from people who prefer light to dark. 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 😦