1- from typing import Dict , Optional , Union
1+ from typing import Optional , Union
22from warnings import warn
33
44import napari .qt
@@ -141,47 +141,47 @@ def from_napari_css_get_size_of(
141141 return QSize (* fallback )
142142
143143
144- def style_sheet_from_theme (theme : Theme ) -> Dict [str , str ]:
144+ def style_sheet_from_theme (theme : Theme ) -> dict [str , str ]:
145145 """Translate napari theme to a matplotlib style dictionary.
146146
147147 Parameters
148148 ----------
149149 theme : napari.utils.theme.Theme
150150 Napari theme object representing the theme of the current viewer.
151-
151+
152152 Returns
153153 -------
154154 Dict[str, str]
155155 Matplotlib compatible style dictionary.
156156 """
157157 return {
158- ' axes.edgecolor' : theme .secondary .as_hex (),
159- #BUG: could be the same as napari canvas, but facecolors do not get
158+ " axes.edgecolor" : theme .secondary .as_hex (),
159+ # BUG: could be the same as napari canvas, but facecolors do not get
160160 # updated upon redraw for what ever reason
161161 #'axes.facecolor':theme.canvas.as_hex(),
162- ' axes.facecolor' : ' none' ,
163- ' axes.labelcolor' : theme .text .as_hex (),
164- ' boxplot.boxprops.color' : theme .text .as_hex (),
165- ' boxplot.capprops.color' : theme .text .as_hex (),
166- ' boxplot.flierprops.markeredgecolor' : theme .text .as_hex (),
167- ' boxplot.whiskerprops.color' : theme .text .as_hex (),
168- ' figure.edgecolor' : theme .secondary .as_hex (),
169- #BUG: should be the same as napari background, but facecolors do not get
162+ " axes.facecolor" : " none" ,
163+ " axes.labelcolor" : theme .text .as_hex (),
164+ " boxplot.boxprops.color" : theme .text .as_hex (),
165+ " boxplot.capprops.color" : theme .text .as_hex (),
166+ " boxplot.flierprops.markeredgecolor" : theme .text .as_hex (),
167+ " boxplot.whiskerprops.color" : theme .text .as_hex (),
168+ " figure.edgecolor" : theme .secondary .as_hex (),
169+ # BUG: should be the same as napari background, but facecolors do not get
170170 # updated upon redraw for what ever reason
171171 #'figure.facecolor':theme.background.as_hex(),
172- ' figure.facecolor' : ' none' ,
173- ' grid.color' : theme .foreground .as_hex (),
174- #COMMENT: the hard coded colors are to match the previous behaviour
172+ " figure.facecolor" : " none" ,
173+ " grid.color" : theme .foreground .as_hex (),
174+ # COMMENT: the hard coded colors are to match the previous behaviour
175175 # alternativly we could use the theme to style the legend as well
176176 #'legend.edgecolor':theme.secondary.as_hex(),
177- ' legend.edgecolor' : ' black' ,
177+ " legend.edgecolor" : " black" ,
178178 #'legend.facecolor':theme.background.as_hex(),
179- ' legend.facecolor' : ' white' ,
179+ " legend.facecolor" : " white" ,
180180 #'legend.labelcolor':theme.text.as_hex()
181- ' legend.labelcolor' : ' black' ,
182- ' text.color' : theme .text .as_hex (),
183- ' xtick.color' : theme .secondary .as_hex (),
184- ' xtick.labelcolor' : theme .text .as_hex (),
185- ' ytick.color' : theme .secondary .as_hex (),
186- ' ytick.labelcolor' : theme .text .as_hex (),
187- }
181+ " legend.labelcolor" : " black" ,
182+ " text.color" : theme .text .as_hex (),
183+ " xtick.color" : theme .secondary .as_hex (),
184+ " xtick.labelcolor" : theme .text .as_hex (),
185+ " ytick.color" : theme .secondary .as_hex (),
186+ " ytick.labelcolor" : theme .text .as_hex (),
187+ }
0 commit comments