Skip to content

Commit

Permalink
Explicit convert color to string when compile resources (#4997)
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki committed Sep 5, 2022
1 parent 74fd219 commit 68fcadc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion napari/_qt/qt_resources/_svg.py
Expand Up @@ -83,7 +83,7 @@ def colored(
if not color and theme:
from ...utils.theme import get_theme

color = getattr(get_theme(theme, False), theme_key)
color = getattr(get_theme(theme, False), theme_key).as_hex()

return QColoredSVGIcon(self._svg, color, opacity)

Expand Down
3 changes: 2 additions & 1 deletion napari/resources/_icons.py
Expand Up @@ -124,7 +124,8 @@ def generate_colorized_svgs(

clrkey, theme_key = color
theme_key = theme_override.get(svg_stem, theme_key)
color = getattr(get_theme(clrkey, False), theme_key)
color = getattr(get_theme(clrkey, False), theme_key).as_hex()
# convert color to string to fit get_colorized_svg signature

op_key = "" if op == 1 else f"_{op * 100:.0f}"
alias = ALIAS_T.format(color=clrkey, svg_stem=svg_stem, opacity=op_key)
Expand Down

0 comments on commit 68fcadc

Please sign in to comment.