1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:37:34 +00:00

LibGfx: Add Color::from_named_css_color_string

This is factored out from Color::from_string and determines the color
only from performing an ASCII case-insensitive search over the named
CSS colors.
This commit is contained in:
Shannon Booth 2023-05-28 15:01:54 +12:00 committed by Andreas Kling
parent f5bf53bc99
commit 15151d7a4c
2 changed files with 17 additions and 4 deletions

View file

@ -378,6 +378,7 @@ public:
DeprecatedString to_deprecated_string() const;
DeprecatedString to_deprecated_string_without_alpha() const;
static Optional<Color> from_string(StringView);
static Optional<Color> from_named_css_color_string(StringView);
constexpr HSV to_hsv() const
{