@@ -143,30 +143,37 @@ struct ThemePalette {
144impl Default for ThemePalette {
144impl Default for ThemePalette {
145 fn default() -> Self {
145 fn default() -> Self {
146− Self::new(hashmap! {
147+ palette: hashmap! {
147− "black".to_string() => Color::Black,
148+ "black".to_string() => Color::Black,
148− "red".to_string() => Color::Red,
149+ "red".to_string() => Color::Red,
149− "green".to_string() => Color::Green,
150+ "green".to_string() => Color::Green,
150− "yellow".to_string() => Color::Yellow,
151+ "yellow".to_string() => Color::Yellow,
151− "blue".to_string() => Color::Blue,
152+ "blue".to_string() => Color::Blue,
152− "magenta".to_string() => Color::Magenta,
153+ "magenta".to_string() => Color::Magenta,
153− "cyan".to_string() => Color::Cyan,
154+ "cyan".to_string() => Color::Cyan,
154− "gray".to_string() => Color::Gray,
155+ "gray".to_string() => Color::Gray,
155− "light-red".to_string() => Color::LightRed,
156+ "light-red".to_string() => Color::LightRed,
156− "light-green".to_string() => Color::LightGreen,
157+ "light-green".to_string() => Color::LightGreen,
157− "light-yellow".to_string() => Color::LightYellow,
158+ "light-yellow".to_string() => Color::LightYellow,
158− "light-blue".to_string() => Color::LightBlue,
159+ "light-blue".to_string() => Color::LightBlue,
159− "light-magenta".to_string() => Color::LightMagenta,
160+ "light-magenta".to_string() => Color::LightMagenta,
160− "light-cyan".to_string() => Color::LightCyan,
161+ "light-cyan".to_string() => Color::LightCyan,
161− "light-gray".to_string() => Color::LightGray,
162+ "light-gray".to_string() => Color::LightGray,
162− "white".to_string() => Color::White,
163+ "white".to_string() => Color::White,
167impl ThemePalette {
169impl ThemePalette {
168 pub fn new(palette: HashMap<String, Color>) -> Self {
170 pub fn new(palette: HashMap<String, Color>) -> Self {
172+ palette: mut default,
173+ } = ThemePalette::default();
175+ default.extend(palette);
169− Self { palette }
176+ Self { palette: default }
172 pub fn hex_string_to_rgb(s: &str) -> Result<Color, String> {
179 pub fn hex_string_to_rgb(s: &str) -> Result<Color, String> {