use crate::spec_ai_tui::style::{Color, Style};
#[derive(Debug, Clone)]
pub struct Palette {
pub primary: Color,
pub secondary: Color,
pub background: Color,
pub surface: Color,
pub text: Color,
pub text_muted: Color,
pub success: Color,
pub warning: Color,
pub error: Color,
pub border: Color,
}
impl Default for Palette {
fn default() -> Self {
Self::dark()
}
}
impl Palette {
pub fn dark() -> Self {
Self {
primary: Color::Cyan,
secondary: Color::Magenta,
background: Color::Reset,
surface: Color::DarkGrey,
text: Color::White,
text_muted: Color::Grey,
success: Color::Green,
warning: Color::Yellow,
error: Color::Red,
border: Color::DarkGrey,
}
}
pub fn light() -> Self {
Self {
primary: Color::Blue,
secondary: Color::Magenta,
background: Color::White,
surface: Color::Grey,
text: Color::Black,
text_muted: Color::DarkGrey,
success: Color::DarkGreen,
warning: Color::DarkYellow,
error: Color::DarkRed,
border: Color::Grey,
}
}
}
#[derive(Debug, Clone)]
pub struct Theme {
pub palette: Palette,
pub status_bar: Style,
pub input: Style,
pub input_cursor: Style,
pub border: Style,
pub border_focused: Style,
pub header: Style,
pub selection: Style,
}
impl Default for Theme {
fn default() -> Self {
Self::dark()
}
}
impl Theme {
pub fn dark() -> Self {
let palette = Palette::dark();
Self {
status_bar: Style::new().bg(palette.surface).fg(palette.text),
input: Style::new().fg(palette.text),
input_cursor: Style::new().bg(palette.text).fg(palette.background),
border: Style::new().fg(palette.border),
border_focused: Style::new().fg(palette.primary),
header: Style::new().fg(palette.primary).bold(),
selection: Style::new().bg(palette.primary).fg(palette.background),
palette,
}
}
pub fn light() -> Self {
let palette = Palette::light();
Self {
status_bar: Style::new().bg(palette.surface).fg(palette.text),
input: Style::new().fg(palette.text),
input_cursor: Style::new().bg(palette.text).fg(palette.background),
border: Style::new().fg(palette.border),
border_focused: Style::new().fg(palette.primary),
header: Style::new().fg(palette.primary).bold(),
selection: Style::new().bg(palette.primary).fg(palette.background),
palette,
}
}
}