use embedded_graphics::pixelcolor::Rgb565;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct FsTheme {
pub background: Rgb565,
pub surface: Rgb565,
pub surface_alt: Rgb565,
pub accent: Rgb565,
pub text_primary: Rgb565,
pub text_secondary: Rgb565,
pub text_on_accent: Rgb565,
pub success: Rgb565,
pub warning: Rgb565,
pub danger: Rgb565,
pub text_on_danger: Rgb565,
pub dim: Rgb565,
pub tab_bar_height: u32,
pub modal_margin: u32,
}
impl FsTheme {
pub const fn neutral_light() -> Self {
Self {
background: Rgb565::new(31, 63, 31),
surface: Rgb565::new(29, 59, 29),
surface_alt: Rgb565::new(26, 53, 26),
accent: Rgb565::new(5, 24, 29),
text_primary: Rgb565::new(4, 10, 4),
text_secondary: Rgb565::new(10, 21, 10),
text_on_accent: Rgb565::new(31, 63, 31),
success: Rgb565::new(7, 40, 12),
warning: Rgb565::new(31, 43, 5),
danger: Rgb565::new(26, 13, 10),
text_on_danger: Rgb565::new(31, 63, 31),
dim: Rgb565::new(0, 0, 0),
tab_bar_height: 72,
modal_margin: 44,
}
}
pub const fn with_neutral_surfaces(
mut self,
background: Rgb565,
surface: Rgb565,
surface_alt: Rgb565,
) -> Self {
self.background = background;
self.surface = surface;
self.surface_alt = surface_alt;
self
}
pub const fn with_text_colors(mut self, text_primary: Rgb565, text_secondary: Rgb565) -> Self {
self.text_primary = text_primary;
self.text_secondary = text_secondary;
self
}
pub const fn with_accent(mut self, accent: Rgb565, text_on_accent: Rgb565) -> Self {
self.accent = accent;
self.text_on_accent = text_on_accent;
self
}
pub const fn with_status_colors(
mut self,
success: Rgb565,
warning: Rgb565,
danger: Rgb565,
text_on_danger: Rgb565,
) -> Self {
self.success = success;
self.warning = warning;
self.danger = danger;
self.text_on_danger = text_on_danger;
self
}
pub const fn with_dim(mut self, dim: Rgb565) -> Self {
self.dim = dim;
self
}
pub const fn with_metrics(mut self, tab_bar_height: u32, modal_margin: u32) -> Self {
self.tab_bar_height = tab_bar_height;
self.modal_margin = modal_margin;
self
}
}
impl Default for FsTheme {
fn default() -> Self {
Self::neutral_light()
}
}