|
|
@ -143,30 +143,37 @@ struct ThemePalette {
|
|
|
|
|
|
|
|
|
|
|
|
impl Default for ThemePalette {
|
|
|
|
impl Default for ThemePalette {
|
|
|
|
fn default() -> Self {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self::new(hashmap! {
|
|
|
|
Self {
|
|
|
|
"black".to_string() => Color::Black,
|
|
|
|
palette: hashmap! {
|
|
|
|
"red".to_string() => Color::Red,
|
|
|
|
"black".to_string() => Color::Black,
|
|
|
|
"green".to_string() => Color::Green,
|
|
|
|
"red".to_string() => Color::Red,
|
|
|
|
"yellow".to_string() => Color::Yellow,
|
|
|
|
"green".to_string() => Color::Green,
|
|
|
|
"blue".to_string() => Color::Blue,
|
|
|
|
"yellow".to_string() => Color::Yellow,
|
|
|
|
"magenta".to_string() => Color::Magenta,
|
|
|
|
"blue".to_string() => Color::Blue,
|
|
|
|
"cyan".to_string() => Color::Cyan,
|
|
|
|
"magenta".to_string() => Color::Magenta,
|
|
|
|
"gray".to_string() => Color::Gray,
|
|
|
|
"cyan".to_string() => Color::Cyan,
|
|
|
|
"light-red".to_string() => Color::LightRed,
|
|
|
|
"gray".to_string() => Color::Gray,
|
|
|
|
"light-green".to_string() => Color::LightGreen,
|
|
|
|
"light-red".to_string() => Color::LightRed,
|
|
|
|
"light-yellow".to_string() => Color::LightYellow,
|
|
|
|
"light-green".to_string() => Color::LightGreen,
|
|
|
|
"light-blue".to_string() => Color::LightBlue,
|
|
|
|
"light-yellow".to_string() => Color::LightYellow,
|
|
|
|
"light-magenta".to_string() => Color::LightMagenta,
|
|
|
|
"light-blue".to_string() => Color::LightBlue,
|
|
|
|
"light-cyan".to_string() => Color::LightCyan,
|
|
|
|
"light-magenta".to_string() => Color::LightMagenta,
|
|
|
|
"light-gray".to_string() => Color::LightGray,
|
|
|
|
"light-cyan".to_string() => Color::LightCyan,
|
|
|
|
"white".to_string() => Color::White,
|
|
|
|
"light-gray".to_string() => Color::LightGray,
|
|
|
|
})
|
|
|
|
"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> {
|
|
|
|