Skip to content

Commit 4193414

Browse files
committed
feat(core): Add theme-aware color constants
Introduces a `Colors` class to encapsulate ANSI color codes. This class now includes getter methods (`get_primary`, etc.) to allow for themes and more flexible color management within the application. Affected files: - M smart_git_commit/smart_git_commit.py
1 parent 271de99 commit 4193414

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

smart_git_commit/smart_git_commit.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@
6868

6969
# ANSI color codes for terminal output
7070
class Colors:
71+
"""
72+
ANSI color codes for terminal output with theme support.
73+
74+
This class provides both direct color constants and themed color getters.
75+
Always prefer the getter methods (get_primary, get_secondary, etc.) over
76+
direct color constants to ensure theme consistency and proper fallback
77+
behavior when terminal doesn't support colors.
78+
79+
Example usage:
80+
print(f"{Colors.get_primary()}Themed primary text{Colors.RESET}")
81+
print(f"{Colors.get_error()}Error message{Colors.RESET}")
82+
83+
Available themes:
84+
- "standard" - Basic ANSI colors
85+
- "cyberpunk" - Vibrant cyberpunk-inspired color scheme
86+
"""
7187
# Basic ANSI colors
7288
RESET = "\033[0m"
7389
BOLD = "\033[1m"

0 commit comments

Comments
 (0)