diff --git a/rich/syntax.py b/rich/syntax.py index cff8fd235..246a19acd 100644 --- a/rich/syntax.py +++ b/rich/syntax.py @@ -162,7 +162,7 @@ def get_style_for_token(self, token_type: TokenType) -> Style: color = pygments_style["color"] bgcolor = pygments_style["bgcolor"] style = Style( - color="#" + color if color else "#000000", + color="#" + color if color else None, bgcolor="#" + bgcolor if bgcolor else self._background_color, bold=pygments_style["bold"], italic=pygments_style["italic"],