mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 00:56:39 +00:00
LibGfx: Implement a UTF-16 Color stringifier
This commit is contained in:
parent
96e75a023b
commit
f3146d3320
Notes:
github-actions[bot]
2025-07-28 10:26:49 +00:00
Author: https://github.com/trflynn89
Commit: f3146d3320
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5610
2 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <AK/StringConversions.h>
|
#include <AK/StringConversions.h>
|
||||||
#include <AK/Swift.h>
|
#include <AK/Swift.h>
|
||||||
|
#include <AK/Utf16String.h>
|
||||||
#include <AK/Utf16View.h>
|
#include <AK/Utf16View.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibGfx/Color.h>
|
#include <LibGfx/Color.h>
|
||||||
|
@ -54,6 +55,11 @@ String Color::to_string_without_alpha() const
|
||||||
return MUST(String::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue()));
|
return MUST(String::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utf16String Color::to_utf16_string_without_alpha() const
|
||||||
|
{
|
||||||
|
return Utf16String::formatted("#{:02x}{:02x}{:02x}", red(), green(), blue());
|
||||||
|
}
|
||||||
|
|
||||||
ByteString Color::to_byte_string() const
|
ByteString Color::to_byte_string() const
|
||||||
{
|
{
|
||||||
return to_string().to_byte_string();
|
return to_string().to_byte_string();
|
||||||
|
|
|
@ -487,6 +487,7 @@ public:
|
||||||
|
|
||||||
[[nodiscard]] String to_string(HTMLCompatibleSerialization = HTMLCompatibleSerialization::No) const;
|
[[nodiscard]] String to_string(HTMLCompatibleSerialization = HTMLCompatibleSerialization::No) const;
|
||||||
String to_string_without_alpha() const;
|
String to_string_without_alpha() const;
|
||||||
|
Utf16String to_utf16_string_without_alpha() const;
|
||||||
|
|
||||||
ByteString to_byte_string() const;
|
ByteString to_byte_string() const;
|
||||||
ByteString to_byte_string_without_alpha() const;
|
ByteString to_byte_string_without_alpha() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue