use densa_core::Color;
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub struct Theme {
pub background: Color,
pub surface: Color,
pub raised: Color,
pub hover: Color,
pub pressed: Color,
pub border: Color,
pub text: Color,
pub text_dim: Color,
pub accent: Color,
pub on_accent: Color,
pub selection: Color,
pub focus: Color,
pub font_size: f32,
pub spacing: f32,
}
impl Theme {
pub fn dark() -> Self {
Self {
background: Color::srgb(0x0B1220),
surface: Color::srgb(0x111A2B),
raised: Color::srgb(0x1A2540),
hover: Color::srgb(0x22304A),
pressed: Color::srgb(0x2A3A5C),
border: Color::srgb(0x22304A),
text: Color::srgb(0xE6EDF7),
text_dim: Color::srgb(0x9AA8BE),
accent: Color::srgb(0x2F5BEA),
on_accent: Color::WHITE,
selection: Color::srgb(0x2F5BEA).with_alpha(0.45),
focus: Color::srgb(0x6B9BFF),
font_size: 13.0,
spacing: 4.0,
}
}
pub fn light() -> Self {
Self {
background: Color::srgb(0xF4F6FA),
surface: Color::srgb(0xFFFFFF),
raised: Color::srgb(0xFFFFFF),
hover: Color::srgb(0xEEF2F8),
pressed: Color::srgb(0xE2E8F2),
border: Color::srgb(0xD5DCE6),
text: Color::srgb(0x0B1220),
text_dim: Color::srgb(0x5B6B82),
accent: Color::srgb(0x2F5BEA),
on_accent: Color::WHITE,
selection: Color::srgb(0x2F5BEA).with_alpha(0.25),
focus: Color::srgb(0x2F5BEA),
font_size: 13.0,
spacing: 4.0,
}
}
}
impl Default for Theme {
fn default() -> Self {
Self::dark()
}
}