diff options
author | Robert Günzler <robertguenzler@gmail.com> | 2017-06-12 12:16:57 +0200 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-10-09 10:14:43 -0700 |
commit | 68cca6eb381f88e861439ed6a1dda1ab6a7429d3 (patch) | |
tree | 40a8d8d3886bfee8a1328349f436740bca1cf6d6 /src/config.rs | |
parent | fc658b31d78e791319847eb9069709d6892f6c3c (diff) | |
download | alacritty-68cca6eb381f88e861439ed6a1dda1ab6a7429d3.tar.gz alacritty-68cca6eb381f88e861439ed6a1dda1ab6a7429d3.zip |
Support web notation for hex colors
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 7 |
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); |