|
|
@ -143,7 +143,8 @@ struct ThemePalette {
|
|
|
|
|
|
|
|
|
|
|
|
impl Default for ThemePalette {
|
|
|
|
impl Default for ThemePalette {
|
|
|
|
fn default() -> Self {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new(hashmap! {
|
|
|
|
Self {
|
|
|
|
|
|
|
|
palette: hashmap! {
|
|
|
|
"black".to_string() => Color::Black,
|
|
|
|
"black".to_string() => Color::Black,
|
|
|
|
"red".to_string() => Color::Red,
|
|
|
|
"red".to_string() => Color::Red,
|
|
|
|
"green".to_string() => Color::Green,
|
|
|
|
"green".to_string() => Color::Green,
|
|
|
@ -160,13 +161,19 @@ impl Default for ThemePalette {
|
|
|
|
"light-cyan".to_string() => Color::LightCyan,
|
|
|
|
"light-cyan".to_string() => Color::LightCyan,
|
|
|
|
"light-gray".to_string() => Color::LightGray,
|
|
|
|
"light-gray".to_string() => Color::LightGray,
|
|
|
|
"white".to_string() => Color::White,
|
|
|
|
"white".to_string() => Color::White,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
impl ThemePalette {
|
|
|
|
impl ThemePalette {
|
|
|
|
pub fn new(palette: HashMap<String, Color>) -> Self {
|
|
|
|
pub fn new(palette: HashMap<String, Color>) -> Self {
|
|
|
|
Self { palette }
|
|
|
|
let ThemePalette {
|
|
|
|
|
|
|
|
palette: mut default,
|
|
|
|
|
|
|
|
} = ThemePalette::default();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default.extend(palette);
|
|
|
|
|
|
|
|
Self { palette: default }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn hex_string_to_rgb(s: &str) -> Result<Color, String> {
|
|
|
|
pub fn hex_string_to_rgb(s: &str) -> Result<Color, String> {
|
|
|
|