diff --git a/Libraries/LibGfx/Color.cpp b/Libraries/LibGfx/Color.cpp index 1837ddb711c..28c73e0a0fa 100644 --- a/Libraries/LibGfx/Color.cpp +++ b/Libraries/LibGfx/Color.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -367,6 +368,11 @@ Optional Color::from_string(StringView string) return {}; } +Optional Color::from_utf16_string(Utf16View const& string) +{ + return from_string(string.to_utf8_but_should_be_ported_to_utf16()); +} + Vector Color::shades(u32 steps, float max) const { float shade = 1.f; diff --git a/Libraries/LibGfx/Color.h b/Libraries/LibGfx/Color.h index 45fe061cfb8..3d2d9980bb0 100644 --- a/Libraries/LibGfx/Color.h +++ b/Libraries/LibGfx/Color.h @@ -491,6 +491,7 @@ public: ByteString to_byte_string() const; ByteString to_byte_string_without_alpha() const; static Optional from_string(StringView); + static Optional from_utf16_string(Utf16View const&); static Optional from_named_css_color_string(StringView); constexpr HSV to_hsv() const