//! Theme and colour palette. //! //! Two themes are provided — one for light terminal backgrounds //! and one for dark — per NFR-7. The palette is intentionally //! small for the walking skeleton; it grows as more views are //! added. Contrast is chosen against the target background so //! that foreground text meets WCAG-AA (NFR-5) on both variants. use ratatui::style::Color; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Background { Light, Dark, } #[derive(Debug, Clone)] pub struct Theme { pub background: Background, pub bg: Color, pub fg: Color, pub muted: Color, pub border: Color, pub border_advanced: Color, pub mode_simple: Color, pub mode_advanced: Color, pub system: Color, pub error: Color, } impl Theme { #[must_use] pub const fn dark() -> Self { Self { background: Background::Dark, bg: Color::Rgb(0x18, 0x1B, 0x22), fg: Color::Rgb(0xE6, 0xE6, 0xE6), muted: Color::Rgb(0x8B, 0x90, 0x9A), border: Color::Rgb(0x4A, 0x52, 0x65), border_advanced: Color::Rgb(0xE0, 0x60, 0x60), mode_simple: Color::Rgb(0x6E, 0xC4, 0xFF), mode_advanced: Color::Rgb(0xFF, 0x9E, 0x6B), system: Color::Rgb(0x9F, 0xD8, 0x91), error: Color::Rgb(0xFF, 0x6B, 0x6B), } } #[must_use] pub const fn light() -> Self { Self { background: Background::Light, bg: Color::Rgb(0xFA, 0xFA, 0xF7), fg: Color::Rgb(0x1A, 0x1F, 0x2C), muted: Color::Rgb(0x60, 0x66, 0x73), border: Color::Rgb(0xB6, 0xBC, 0xC8), border_advanced: Color::Rgb(0xC2, 0x3A, 0x3A), mode_simple: Color::Rgb(0x21, 0x69, 0xC7), mode_advanced: Color::Rgb(0xB0, 0x4A, 0x12), system: Color::Rgb(0x2E, 0x7C, 0x3C), error: Color::Rgb(0xC0, 0x39, 0x2B), } } } impl Default for Theme { fn default() -> Self { Self::dark() } }