Skip to content

Commit

Permalink
a few color themes and test to print them. passing -s with test comma…
Browse files Browse the repository at this point in the history
…nd should print.
  • Loading branch information
Deanna authored and Deanna committed Sep 27, 2024
1 parent f4ab6c5 commit de39b08
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
56 changes: 28 additions & 28 deletions src/prettytable/colortable.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,34 @@ def format_code(s: str) -> str:
class Themes:
DEFAULT = Theme()
DYSLEXIA_FRIENDLY = Theme(
default_color="38;5;223", # Light cream
vertical_color="38;5;22", # Dark green
horizontal_color="38;5;22", # Dark green
junction_color="38;5;58", # Dark yellow
default_color="38;5;223",
vertical_color="38;5;22",
horizontal_color="38;5;22",
junction_color="38;5;58",
)
EARTH = Theme(
default_color="33", # Yellow
vertical_color="38;5;94", # Brown
horizontal_color="38;5;22", # Dark Green
junction_color="38;5;130", # Dark Orange
default_color="33",
vertical_color="38;5;94",
horizontal_color="38;5;22",
junction_color="38;5;130",
)
GLARE_REDUCTION = Theme(
default_color="38;5;252", # Light grey
vertical_color="38;5;240", # Dark grey
horizontal_color="38;5;240", # Dark grey
junction_color="38;5;246", # Medium grey
default_color="38;5;252",
vertical_color="38;5;240",
horizontal_color="38;5;240",
junction_color="38;5;246",
)
HIGH_CONTRAST = Theme(
default_color="97", # Bright White
vertical_color="91", # Bright Red
horizontal_color="94", # Bright Blue
junction_color="93", # Bright Yellow
default_color="97",
vertical_color="91",
horizontal_color="94",
junction_color="93",
)
LAVENDER = Theme(
default_color="38;5;183", # Light Purple
vertical_color="35", # Magenta
horizontal_color="38;5;147", # Medium Purple
junction_color="38;5;219", # Pink
default_color="38;5;183",
vertical_color="35",
horizontal_color="38;5;147",
junction_color="38;5;219",
)
OCEAN = Theme(
default_color="96",
Expand All @@ -82,16 +82,16 @@ class Themes:
junction_color="36",
)
OCEAN_DEEP = Theme(
default_color="96", # Cyan
vertical_color="34", # Blue
horizontal_color="36", # Light Cyan
junction_color="94", # Light Blue
default_color="96",
vertical_color="34",
horizontal_color="36",
junction_color="94",
)
PASTEL = Theme(
default_color="38;5;223", # Light Peach
vertical_color="38;5;152", # Light Blue
horizontal_color="38;5;187", # Light Pink
junction_color="38;5;157", # Light Green
default_color="38;5;223",
vertical_color="38;5;152",
horizontal_color="38;5;187",
junction_color="38;5;157",
)


Expand Down
3 changes: 1 addition & 2 deletions tests/test_colortable.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def test_color_table_rendering(self) -> None:
result = str(table)

assert expected == result

def test_all_themes(self) -> None:
"""Tests rendering with all available themes"""
table = ColorTable(
Expand All @@ -171,4 +171,3 @@ def test_all_themes(self) -> None:
print(f"\n{theme_name} Theme:")
print(result)
assert result # Simple check to ensure rendering doesn't fail

0 comments on commit de39b08

Please sign in to comment.