#[derive(Debug, Clone)]
pub struct BookTheme {
pub bg: u32,
pub page_bg: u32,
pub page_bg_right: u32,
pub text: u32,
pub title: u32,
pub nav: u32,
pub nav_selected: u32,
pub nav_selected_bg: u32,
pub border: u32,
pub nameplate: u32,
pub divider: u32,
#[allow(dead_code)]
pub sidebar_bg: u32,
}
impl Default for BookTheme {
fn default() -> Self {
Self {
bg: 0xFF_2A1A08, page_bg: 0xFF_F5E6C8, page_bg_right: 0xFF_EECF9A, text: 0xFF_3B2008, title: 0xFF_7A3A00, nav: 0xFF_5C4020, nav_selected: 0xFF_C87820, nav_selected_bg: 0x50_C87820, border: 0xFF_5C3A10, nameplate: 0xFF_C8A050, divider: 0xFF_8B6030, sidebar_bg: 0xFF_2A1A08, }
}
}
impl BookTheme {
pub fn with_nameplate(mut self, hex: &str) -> Self {
if let Ok(v) = u32::from_str_radix(hex.trim_start_matches('#'), 16) {
self.nameplate = 0xFF_000000 | v;
self.title = 0xFF_000000 | v;
}
self
}
}