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:
parent
fc658b31d7
commit
68cca6eb38
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue