1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-11 13:51:01 -05:00

Support web notation for hex colors

This commit is contained in:
Robert Günzler 2017-06-12 12:16:57 +02:00 committed by Joe Wilm
parent fc658b31d7
commit 68cca6eb38

View file

@ -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);