Skip to content

Commit

Permalink
don't override terminal foreground color for pygments themes
Browse files Browse the repository at this point in the history
Styles without a color should not hardcode to black, and instead use
None, which instructs Pygments to use the terminal's configured
foreground color.
  • Loading branch information
aqw committed Dec 8, 2024
1 parent 43d3b04 commit faf511f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rich/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit faf511f

Please sign in to comment.