use crate::view::Color;
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Theme {
pub background: Color,
pub surface: Color,
pub primary: Color,
pub on_primary: Color,
pub text: Color,
pub text_muted: Color,
pub border: Color,
pub border_focused: Color,
pub radius: f32,
pub font_size: f32,
}
impl Theme {
pub fn light() -> Self {
Self {
background: Color::rgb(1.0, 1.0, 1.0),
surface: Color::rgb(0.94, 0.94, 0.96),
primary: Color::rgb(0.0, 0.47, 1.0),
on_primary: Color::WHITE,
text: Color::BLACK,
text_muted: Color::rgb(0.5, 0.5, 0.5),
border: Color::rgb(0.75, 0.75, 0.75),
border_focused: Color::rgb(0.0, 0.47, 1.0),
radius: 8.0,
font_size: 16.0,
}
}
pub fn dark() -> Self {
Self {
background: Color::rgb(0.1, 0.1, 0.12),
surface: Color::rgb(0.16, 0.16, 0.18),
primary: Color::rgb(0.35, 0.55, 1.0),
on_primary: Color::WHITE,
text: Color::rgb(0.92, 0.92, 0.92),
text_muted: Color::rgb(0.55, 0.55, 0.55),
border: Color::rgb(0.3, 0.3, 0.32),
border_focused: Color::rgb(0.35, 0.55, 1.0),
radius: 8.0,
font_size: 16.0,
}
}
}