aboutsummaryrefslogtreecommitdiffstats
path: root/src/themes.rs
diff options
context:
space:
mode:
authorkhai96_ <hvksmr1996@gmail.com>2019-05-17 07:11:38 +0000
committerkhai96_ <hvksmr1996@gmail.com>2019-05-17 07:11:38 +0000
commita77c71dde6a480c8c6a096b7cacd03de63a5ee6b (patch)
tree41709cb3662e07031cf318cb64404ea2d645bf92 /src/themes.rs
parentUpdate unit tests (diff)
parentMerge pull request #116 from svenstaro/dependabot/cargo/reqwest-0.9.17 (diff)
downloadminiserve-a77c71dde6a480c8c6a096b7cacd03de63a5ee6b.tar.gz
miniserve-a77c71dde6a480c8c6a096b7cacd03de63a5ee6b.zip
Merge remote-tracking branch 'mainrepo/master' into multiple-auths-alt
Diffstat (limited to 'src/themes.rs')
-rw-r--r--src/themes.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/themes.rs b/src/themes.rs
index a7b619e..65e9ab2 100644
--- a/src/themes.rs
+++ b/src/themes.rs
@@ -3,7 +3,7 @@ use structopt::clap::arg_enum;
use strum_macros::EnumIter;
arg_enum! {
- #[derive(PartialEq, Deserialize, Clone, EnumIter)]
+ #[derive(PartialEq, Deserialize, Clone, EnumIter, Copy)]
#[serde(rename_all = "lowercase")]
pub enum ColorScheme {
Archlinux,
@@ -17,8 +17,8 @@ impl ColorScheme {
/// Returns the URL-compatible name of a color scheme
/// This must correspond to the name of the variant, in lowercase
/// See https://github.com/svenstaro/miniserve/pull/55 for explanations
- pub fn to_slug(&self) -> String {
- match &self {
+ pub fn to_slug(self) -> String {
+ match self {
ColorScheme::Archlinux => "archlinux",
ColorScheme::Zenburn => "zenburn",
ColorScheme::Monokai => "monokai",
@@ -28,8 +28,8 @@ impl ColorScheme {
}
/// Returns wether a color scheme is dark
- pub fn is_dark(&self) -> bool {
- match &self {
+ pub fn is_dark(self) -> bool {
+ match self {
ColorScheme::Archlinux => true,
ColorScheme::Zenburn => true,
ColorScheme::Monokai => true,
@@ -81,6 +81,7 @@ impl ColorScheme {
drag_text_color: "#fefefe".to_string(),
size_background_color: "#5294e2".to_string(),
size_text_color: "#fefefe".to_string(),
+ error_color: "#e44b4b".to_string(),
},
ColorScheme::Zenburn => Theme {
background: "#3f3f3f".to_string(),
@@ -123,6 +124,7 @@ impl ColorScheme {
drag_text_color: "#efefef".to_string(),
size_background_color: "#7f9f7f".to_string(),
size_text_color: "#efefef".to_string(),
+ error_color: "#d06565".to_string(),
},
ColorScheme::Monokai => Theme {
background: "#272822".to_string(),
@@ -165,6 +167,7 @@ impl ColorScheme {
drag_text_color: "#F8F8F2".to_string(),
size_background_color: "#75715E".to_string(),
size_text_color: "#F8F8F2".to_string(),
+ error_color: "#d02929".to_string(),
},
ColorScheme::Squirrel => Theme {
background: "#FFFFFF".to_string(),
@@ -207,6 +210,7 @@ impl ColorScheme {
drag_text_color: "#ffffff".to_string(),
size_background_color: "#323232".to_string(),
size_text_color: "#FFFFFF".to_string(),
+ error_color: "#d02424".to_string(),
},
}
}
@@ -254,4 +258,5 @@ pub struct Theme {
pub drag_text_color: String,
pub size_background_color: String,
pub size_text_color: String,
+ pub error_color: String,
}