Files
cs249r_book/tinytorch/tito/core/theme.py
Vijay Janapa Reddi 447b2c53e0 refactor(cli): add centralized color theme system
- Add theme.py with consistent color constants
- Refactor console.py to use Theme class
- Standardizes colors for brand, status, and UI elements
2025-12-11 13:31:52 -08:00

57 lines
2.3 KiB
Python
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
TinyTorch CLI Color Theme
Consistent color palette for all CLI output.
Logo-inspired but terminal-safe for both dark and light backgrounds.
"""
class Theme:
"""Centralized color constants for CLI styling."""
# ==========================================
# BRAND COLORS
# ==========================================
BRAND_ACCENT = "orange1" # Primary brand color (matches logo "tiny")
BRAND_PRIMARY = "bold white" # Main text (TORCH - navy doesn't work on dark terminals)
BRAND_FLAME = "yellow" # Flame emoji styling
# ==========================================
# SEMANTIC COLORS (Status Messages)
# ==========================================
SUCCESS = "green" # ✅ Success messages, completed status
WARNING = "yellow" # ⚠️ Warnings, caution messages
ERROR = "red" # ❌ Errors, failures
INFO = "cyan" # Info messages, general information
# ==========================================
# UI COLORS (Help & Navigation)
# ==========================================
COMMAND = "bright_green" # Command names in help text
OPTION = "yellow" # CLI options, arguments, flags
SECTION = "bold cyan" # Section headers
DIM = "dim" # Secondary text, descriptions
EMPHASIS = "bold white" # Important highlighted text
# ==========================================
# PANEL BORDERS
# ==========================================
BORDER_DEFAULT = "bright_blue" # Default panel border
BORDER_SUCCESS = "green" # Success panel border
BORDER_WARNING = "yellow" # Warning panel border
BORDER_ERROR = "red" # Error panel border
BORDER_INFO = "cyan" # Info panel border
BORDER_WELCOME = "bright_green" # Welcome screen border
# ==========================================
# CATEGORY COLORS (Command Groups)
# ==========================================
CAT_QUICKSTART = "bright_green" # Quick start commands
CAT_PROGRESS = "yellow" # Progress tracking commands
CAT_COMMUNITY = "cyan" # Community commands
CAT_HELP = "magenta" # Help & docs commands
# Convenience aliases for common patterns
COLORS = Theme