use ratatui::style::Color;
use zero_operator_state::label::ColorHint;
#[derive(Debug, Clone, Copy)]
pub struct Theme {
pub primary: Color,
pub caution: Color,
pub alert: Color,
pub muted: Color,
pub metadata: Color,
}
impl Theme {
#[must_use]
pub const fn phosphor() -> Self {
Self {
primary: Color::Indexed(148),
caution: Color::Indexed(214),
alert: Color::Indexed(196),
muted: Color::Indexed(100),
metadata: Color::Indexed(244),
}
}
#[must_use]
pub const fn resolve_hint(&self, hint: ColorHint) -> Color {
match hint {
ColorHint::Phosphor => self.primary,
ColorHint::Amber => self.caution,
ColorHint::Red => self.alert,
ColorHint::MutedOlive => self.muted,
}
}
}
impl Default for Theme {
fn default() -> Self {
Self::phosphor()
}
}