Skip to content

Commit 9d6170e

Browse files
committed
Fix as_dict deprecation warnings by deleting it.
1 parent 9c166c6 commit 9d6170e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: src/napari_matplotlib/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(
4242
super().__init__(parent=parent)
4343
self.viewer = napari_viewer
4444
self.napari_theme_style_sheet = style_sheet_from_theme(
45-
get_theme(napari_viewer.theme, as_dict=False)
45+
get_theme(napari_viewer.theme)
4646
)
4747

4848
# Sets figure.* style
@@ -84,7 +84,7 @@ def _on_napari_theme_changed(self, event: Event) -> None:
8484
Event that triggered the callback.
8585
"""
8686
self.napari_theme_style_sheet = style_sheet_from_theme(
87-
get_theme(event.value, as_dict=False)
87+
get_theme(event.value)
8888
)
8989
self._replace_toolbar_icons()
9090

@@ -97,7 +97,7 @@ def _napari_theme_has_light_bg(self) -> bool:
9797
bool
9898
True if theme's background colour has hsl lighter than 50%, False if darker.
9999
"""
100-
theme = napari.utils.theme.get_theme(self.viewer.theme, as_dict=False)
100+
theme = napari.utils.theme.get_theme(self.viewer.theme)
101101
_, _, bg_lightness = theme.background.as_hsl_tuple()
102102
return bg_lightness > 0.5
103103

Diff for: src/napari_matplotlib/tests/test_theme.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _mock_up_theme() -> None:
2929
Based on:
3030
https://napari.org/stable/gallery/new_theme.html
3131
"""
32-
blue_theme = napari.utils.theme.get_theme("dark", False)
32+
blue_theme = napari.utils.theme.get_theme("dark")
3333
blue_theme.label = "blue"
3434
blue_theme.background = "#4169e1" # my favourite shade of blue
3535
napari.utils.theme.register_theme(

0 commit comments

Comments
 (0)