2026-07-12 11:28:39 +07:00
|
|
|
//! Central color theme for the TUI.
|
|
|
|
|
//!
|
|
|
|
|
//! Flow: defines a single `Theme` marker struct with associated `Color`
|
|
|
|
|
//! consts, consumed by every `view/*` render function so styling stays
|
|
|
|
|
//! consistent and changeable from one place.
|
|
|
|
|
//!
|
|
|
|
|
//! Why: a zero-sized struct with associated consts (rather than an enum
|
|
|
|
|
//! or a runtime-configured palette) keeps color lookups compile-time
|
|
|
|
|
//! constant and allocation-free.
|
|
|
|
|
|
2026-07-11 13:16:10 +07:00
|
|
|
use ratatui::style::Color;
|
|
|
|
|
|
2026-07-12 11:28:39 +07:00
|
|
|
/// Central palette of terminal colors used across all TUI render functions.
|
|
|
|
|
///
|
|
|
|
|
/// Why: a zero-sized marker struct holding only associated consts, so
|
|
|
|
|
/// every view module references colors as `Theme::NAME` instead of
|
|
|
|
|
/// hardcoding `ratatui::style::Color` values inline.
|
2026-07-11 13:16:10 +07:00
|
|
|
pub struct Theme;
|
|
|
|
|
|
|
|
|
|
impl Theme {
|
|
|
|
|
pub const PRIMARY: Color = Color::Cyan;
|
|
|
|
|
pub const SUCCESS: Color = Color::Green;
|
|
|
|
|
pub const WARNING: Color = Color::Yellow;
|
|
|
|
|
pub const ERROR: Color = Color::Red;
|
|
|
|
|
pub const INFO: Color = Color::Blue;
|
|
|
|
|
pub const TEXT: Color = Color::White;
|
|
|
|
|
pub const DIM: Color = Color::DarkGray;
|
|
|
|
|
pub const HIGHLIGHT: Color = Color::LightYellow;
|
|
|
|
|
pub const BORDER: Color = Color::Gray;
|
|
|
|
|
pub const ROLE_USER: Color = Color::Green;
|
|
|
|
|
pub const ROLE_ASSISTANT: Color = Color::Cyan;
|
|
|
|
|
pub const ROLE_SYSTEM: Color = Color::Blue;
|
|
|
|
|
pub const ROLE_TOOL: Color = Color::Yellow;
|
|
|
|
|
pub const BG: Color = Color::Reset;
|
|
|
|
|
pub const STATUS_BAR_BG: Color = Color::Blue;
|
|
|
|
|
pub const MODE_AUTO: Color = Color::Green;
|
|
|
|
|
pub const MODE_YOLO: Color = Color::Red;
|
|
|
|
|
}
|