1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibGfx+LibWeb: Move "transparent" keyword into Color::from_string()

It seemed odd to have this one color handled separately, when
`Color::from_string()` implements all other CSS colors.
This commit is contained in:
Sam Atkins 2021-10-23 13:05:38 +01:00 committed by Andreas Kling
parent 2ab089fa21
commit 21b65de1ec
2 changed files with 3 additions and 2 deletions

View file

@ -2087,8 +2087,6 @@ Optional<Color> Parser::parse_color(ParsingContext const&, StyleComponentValueRu
// https://www.w3.org/TR/css-color-3/
if (component_value.is(Token::Type::Ident)) {
auto ident = component_value.token().ident();
if (ident.equals_ignoring_case("transparent"))
return Color::from_rgba(0x00000000);
auto color = Color::from_string(ident.to_string().to_lowercase());
if (color.has_value())