use ratatui::style::{Color, Modifier, Style};
#[derive(Debug, Clone, Copy)]
pub struct Theme {
pub border_focused: Style,
pub border_unfocused: Style,
pub border_popup: Style,
pub border_error: Style,
pub border_warning: Style,
pub tab_active: Style,
pub tab_inactive: Style,
pub selection: Style,
pub shortcut_key: Style,
pub shortcut_indicator: Style,
pub section_header: Style,
pub body: Style,
pub hint: Style,
pub separator: Style,
pub success: Style,
}
impl Theme {
pub fn native() -> Self {
Self {
border_focused: Style::default()
.fg(Color::LightBlue)
.add_modifier(Modifier::BOLD),
border_unfocused: Style::default().fg(Color::DarkGray),
border_popup: Style::default()
.fg(Color::LightBlue)
.add_modifier(Modifier::BOLD),
border_error: Style::default()
.fg(Color::LightRed)
.add_modifier(Modifier::BOLD),
border_warning: Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
tab_active: Style::default()
.fg(Color::LightBlue)
.add_modifier(Modifier::BOLD),
tab_inactive: Style::default().fg(Color::DarkGray),
selection: Style::default()
.fg(Color::Black)
.bg(Color::LightBlue)
.add_modifier(Modifier::BOLD),
shortcut_key: Style::default().fg(Color::Yellow),
shortcut_indicator: Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
section_header: Style::default()
.fg(Color::LightBlue)
.add_modifier(Modifier::BOLD),
body: Style::default().fg(Color::Gray),
hint: Style::default().fg(Color::DarkGray),
separator: Style::default().fg(Color::DarkGray),
success: Style::default().fg(Color::LightGreen),
}
}
pub fn dark() -> Self {
Self {
border_focused: Style::default()
.fg(Color::Green)
.add_modifier(Modifier::BOLD),
border_unfocused: Style::default().fg(Color::White),
border_popup: Style::default()
.fg(Color::Green)
.add_modifier(Modifier::BOLD),
border_error: Style::default().fg(Color::Red).add_modifier(Modifier::BOLD),
border_warning: Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
tab_active: Style::default()
.fg(Color::Green)
.add_modifier(Modifier::BOLD),
tab_inactive: Style::default().fg(Color::White),
selection: Style::default()
.fg(Color::Indexed(7))
.bg(Color::Indexed(6))
.add_modifier(Modifier::BOLD),
shortcut_key: Style::default().fg(Color::Yellow),
shortcut_indicator: Style::default()
.fg(Color::Yellow)
.add_modifier(Modifier::BOLD),
section_header: Style::default()
.fg(Color::Cyan)
.add_modifier(Modifier::BOLD),
body: Style::default().fg(Color::Gray),
hint: Style::default().fg(Color::DarkGray),
separator: Style::default().fg(Color::Green),
success: Style::default().fg(Color::Green),
}
}
}
impl Default for Theme {
fn default() -> Self {
Self::native()
}
}