Skip to content

Commit

Permalink
fix(colors): use colors adapted on both dark and light background
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme Deuchnord authored and Deuchnord committed Nov 19, 2021
1 parent 5661e60 commit 9bdb490
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _kosmorro/dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ def style(self, text: str, tag: str) -> str:
return text

styles = {
"h1": lambda t: colored(t, "yellow", attrs=["bold"]),
"h1": lambda t: colored(t, "green", attrs=["bold"]),
"h2": lambda t: colored(t, "magenta", attrs=["bold"]),
"th": lambda t: colored(t, "white", attrs=["bold"]),
"th": lambda t: colored(t, attrs=["bold"]),
"strong": lambda t: colored(t, attrs=["bold"]),
"em": lambda t: colored(t, attrs=["dark"]),
}

return styles[tag](text)
return styles.get(tag, lambda t: t)(text)

def stringify_ephemerides(self) -> str:
data = []
Expand Down

0 comments on commit 9bdb490

Please sign in to comment.