Skip to content

Commit 37c5b93

Browse files
committed
Add comments about how colors can be defined
1 parent 4c96b03 commit 37c5b93

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/rich_theme.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ def __init__(self, *args, **kwargs):
2020
self.doc_leader = "Welcome to this glorious help ..."
2121

2222
# Create a custom theme
23+
# Colors can come from the cmd2.color.Color StrEnum class, be RGB hex values, or
24+
# be any of the rich standard colors: https://rich.readthedocs.io/en/stable/appendix/colors.html
2325
custom_theme = {
24-
Cmd2Style.SUCCESS: Style(color=Color.GREEN),
26+
Cmd2Style.SUCCESS: Style(color=Color.GREEN), # Use color from cmd2 Color class
2527
Cmd2Style.WARNING: Style(color=Color.ORANGE1),
2628
Cmd2Style.ERROR: Style(color=Color.PINK1),
2729
Cmd2Style.HELP_HEADER: Style(color=Color.CYAN, bgcolor="#44475a"),
28-
Cmd2Style.HELP_LEADER: Style(color="#f8f8f2", bgcolor="#282a36"),
29-
Cmd2Style.TABLE_BORDER: Style(color=Color.LIGHT_SKY_BLUE1),
30+
Cmd2Style.HELP_LEADER: Style(color="#f8f8f2", bgcolor="#282a36"), # use RGX hex colors
31+
Cmd2Style.TABLE_BORDER: Style(color="turquoise2"), # use a rich standard color
3032
"argparse.args": Style(color=Color.AQUAMARINE3, underline=True),
3133
"inspect.attr": Style(color=Color.DARK_GOLDENROD, bold=True),
3234
}

0 commit comments

Comments
 (0)