| """Theme definitions for AutoRestTest TUI.""" |
|
|
| from dataclasses import dataclass |
|
|
|
|
| @dataclass(frozen=True) |
| class TUITheme: |
| """Color and style definitions for the TUI.""" |
|
|
| |
| primary: str = "#00D4FF" |
| secondary: str = "#FF6B6B" |
| accent: str = "#4ECDC4" |
| success: str = "#2ECC71" |
| warning: str = "#F1C40F" |
| error: str = "#E74C3C" |
| info: str = "#3498DB" |
|
|
| |
| text: str = "#FFFFFF" |
| text_dim: str = "#7F8C8D" |
| text_muted: str = "#566573" |
|
|
| |
| bg_dark: str = "#0D1117" |
| bg_panel: str = "#161B22" |
| bg_highlight: str = "#21262D" |
|
|
| |
| status_2xx: str = "#2ECC71" |
| status_3xx: str = "#3498DB" |
| status_4xx: str = "#F39C12" |
| status_5xx: str = "#E74C3C" |
|
|
| |
| progress_complete: str = "#00D4FF" |
| progress_remaining: str = "#2C3E50" |
|
|
| |
| symbol_success: str = "✓" |
| symbol_error: str = "✗" |
| symbol_warning: str = "⚠" |
| symbol_info: str = "ℹ" |
| symbol_arrow: str = "→" |
| symbol_bullet: str = "•" |
| symbol_progress: str = "⏳" |
|
|
| |
| symbol_success_color: str = "green" |
| symbol_error_color: str = "red" |
| symbol_warning_color: str = "yellow" |
| symbol_info_color: str = "blue" |
| symbol_arrow_color: str = "cyan" |
| symbol_bullet_color: str = "dim" |
| symbol_progress_color: str = "cyan" |
|
|
| def get_status_color(self, status_code: int) -> str: |
| """Return the appropriate color for an HTTP status code.""" |
| if 200 <= status_code < 300: |
| return self.status_2xx |
| elif 300 <= status_code < 400: |
| return self.status_3xx |
| elif 400 <= status_code < 500: |
| return self.status_4xx |
| elif 500 <= status_code < 600: |
| return self.status_5xx |
| return self.text_dim |
|
|
|
|
| |
| DEFAULT_THEME = TUITheme() |
|
|