Skip to content

Commit

Permalink
fix for default background in svg export
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 8, 2022
1 parent 2c93dce commit b6a5824
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rich/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2252,12 +2252,12 @@ def get_svg_style(style: Style) -> str:
css_rules = []
color = (
_theme.foreground_color
if style.color is None
if (style.color is None or style.color.is_default)
else style.color.get_truecolor(_theme)
)
bgcolor = (
_theme.background_color
if style.bgcolor is None
if (style.bgcolor is None or style.bgcolor.is_default)
else style.bgcolor.get_truecolor(_theme)
)
if style.reverse:
Expand Down Expand Up @@ -2365,7 +2365,8 @@ def stringify(value: object) -> str:
else style.color.get_truecolor(_theme).hex
)
else:
has_background = style.bgcolor is not None
bgcolor = style.bgcolor
has_background = bgcolor is not None and not bgcolor.is_default
background = (
_theme.background_color.hex
if style.bgcolor is None
Expand Down

0 comments on commit b6a5824

Please sign in to comment.