aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/config.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index d49caae8..4dffa70a 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -965,8 +965,11 @@ impl FromStr for Rgb {
}
}
- if chars.next().unwrap() != '0' { return Err(()); }
- if chars.next().unwrap() != 'x' { return Err(()); }
+ match chars.next().unwrap() {
+ '0' => if chars.next().unwrap() != 'x' { return Err(()); },
+ '#' => (),
+ _ => return Err(()),
+ }
component!(r, g, b);