use ratatui::style::{Color, Modifier, Style};
pub struct Theme;
impl Theme {
pub const BG_PRIMARY: Color = Color::Rgb(9, 16, 28); pub const BG_SURFACE: Color = Color::Rgb(15, 24, 42); pub const BG_HIGHLIGHT: Color = Color::Rgb(20, 31, 53); pub const BG_OVERLAY: Color = Color::Rgb(10, 19, 35);
pub const BORDER: Color = Color::Rgb(38, 53, 80); pub const BORDER_FOCUS: Color = Color::Rgb(85, 198, 255);
pub const TEXT_PRIMARY: Color = Color::Rgb(243, 246, 251); pub const TEXT_SECONDARY: Color = Color::Rgb(188, 199, 218); pub const TEXT_MUTED: Color = Color::Rgb(145, 160, 184); pub const TEXT_INVERSE: Color = Color::Rgb(8, 17, 29);
pub const HEALTHY: Color = Color::Rgb(96, 211, 148); pub const WARNING: Color = Color::Rgb(255, 177, 90); pub const ERROR: Color = Color::Rgb(255, 107, 87); pub const INFO: Color = Color::Rgb(85, 198, 255);
pub const ACCENT_BLUE: Color = Color::Rgb(85, 198, 255); pub const ACCENT_PURPLE: Color = Color::Rgb(255, 177, 90); pub const ACCENT_CYAN: Color = Color::Rgb(85, 198, 255); pub const ACCENT_ORANGE: Color = Color::Rgb(255, 122, 26);
pub fn title() -> Style {
Style::default()
.fg(Self::ACCENT_ORANGE)
.add_modifier(Modifier::BOLD)
}
pub fn header() -> Style {
Style::default()
.fg(Self::TEXT_PRIMARY)
.bg(Self::BG_HIGHLIGHT)
.add_modifier(Modifier::BOLD)
}
pub fn row_normal() -> Style {
Style::default().fg(Self::TEXT_PRIMARY)
}
pub fn row_selected() -> Style {
Style::default()
.fg(Self::TEXT_PRIMARY)
.bg(Self::BG_HIGHLIGHT)
.add_modifier(Modifier::BOLD)
}
pub fn row_alt() -> Style {
Style::default().fg(Self::TEXT_PRIMARY).bg(Self::BG_SURFACE)
}
pub fn healthy() -> Style {
Style::default()
.fg(Self::HEALTHY)
.add_modifier(Modifier::BOLD)
}
pub fn warning() -> Style {
Style::default()
.fg(Self::WARNING)
.add_modifier(Modifier::BOLD)
}
pub fn error() -> Style {
Style::default()
.fg(Self::ERROR)
.add_modifier(Modifier::BOLD)
}
pub fn info() -> Style {
Style::default().fg(Self::INFO)
}
pub fn muted() -> Style {
Style::default().fg(Self::TEXT_MUTED)
}
pub fn border() -> Style {
Style::default().fg(Self::BORDER)
}
pub fn border_focus() -> Style {
Style::default().fg(Self::BORDER_FOCUS)
}
pub fn status_bar() -> Style {
Style::default()
.fg(Self::TEXT_PRIMARY)
.bg(Self::BG_HIGHLIGHT)
}
pub fn accent() -> Style {
Style::default()
.fg(Self::ACCENT_BLUE)
.add_modifier(Modifier::BOLD)
}
pub fn key_hint() -> Style {
Style::default()
.fg(Self::ACCENT_BLUE)
.add_modifier(Modifier::BOLD)
}
pub fn search_highlight() -> Style {
Style::default()
.fg(Self::TEXT_INVERSE)
.bg(Self::ACCENT_BLUE)
.add_modifier(Modifier::BOLD)
}
pub fn docker() -> Style {
Style::default().fg(Self::ACCENT_BLUE)
}
pub fn tunnel() -> Style {
Style::default().fg(Self::ACCENT_ORANGE)
}
pub fn git_clean() -> Style {
Style::default().fg(Self::HEALTHY)
}
pub fn git_dirty() -> Style {
Style::default().fg(Self::WARNING)
}
pub fn port_number() -> Style {
Style::default()
.fg(Self::ACCENT_ORANGE)
.add_modifier(Modifier::BOLD)
}
pub fn process_name() -> Style {
Style::default().fg(Self::TEXT_PRIMARY)
}
pub fn status_style(status: &crate::models::Status) -> Style {
match status {
crate::models::Status::Healthy => Self::healthy(),
crate::models::Status::Warning(_) => Self::warning(),
crate::models::Status::Zombie => Self::error(),
crate::models::Status::Orphaned => Self::warning(),
crate::models::Status::Unknown => Self::muted(),
}
}
}