From 788b1dd99e5c8c90c49a84a74fa5f6c45ad4ea0e Mon Sep 17 00:00:00 2001 From: Dian M Fay Date: Sat, 5 Jun 2021 18:19:10 -0400 Subject: [PATCH] supply alternate default colors for MCFLY_LIGHT --- src/settings.rs | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/settings.rs b/src/settings.rs index 9e3904d8..b332df05 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -261,7 +261,26 @@ impl Settings { ) .get_matches(); - let mut settings: Settings = Figment::from(Serialized::defaults(Settings::default())) + let mut default_settings = Settings::default(); + + if env::var("MCFLY_LIGHT").is_ok() { + default_settings.colors = Colors { + menu_bg: "Blue".to_string(), + menu_fg: "White".to_string(), + menu_deleting_bg: "Red".to_string(), + menu_deleting_fg: "Cyan".to_string(), + bg: "White".to_string(), + fg: "Black".to_string(), + prompt_fg: "Black".to_string(), + highlight: "Blue".to_string(), + timing: "Blue".to_string(), + cursor_bg: "Dark_Grey".to_string(), + cursor_fg: "White".to_string(), + cursor_highlight: "White".to_string(), + }; + } + + let mut settings: Settings = Figment::from(Serialized::defaults(default_settings)) .merge(Toml::file(Settings::mcfly_config_path())) .extract() .unwrap();