Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit convert color to string when compile resources #4997

Merged
merged 3 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion napari/_qt/qt_resources/_svg.py
Original file line number Diff line number Diff line change
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 = str(getattr(get_theme(theme, False), theme_key))

return QColoredSVGIcon(self._svg, color, opacity)

Expand Down
3 changes: 2 additions & 1 deletion napari/resources/_icons.py
Original file line number Diff line number Diff line change
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 = str(getattr(get_theme(clrkey, False), theme_key))
# 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