mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibGfx: Add Color::to_string_without_alpha()
This simply returns an "#rrggbb" string and ignores the alpha value.
This commit is contained in:
@@ -119,7 +119,12 @@ Color::Color(NamedColor named)
|
||||
|
||||
String Color::to_string() const
|
||||
{
|
||||
return String::format("#%b%b%b%b", red(), green(), blue(), alpha());
|
||||
return String::format("#%02x%02x%02x%02x", red(), green(), blue(), alpha());
|
||||
}
|
||||
|
||||
String Color::to_string_without_alpha() const
|
||||
{
|
||||
return String::format("#%02x%02x%02x", red(), green(), blue());
|
||||
}
|
||||
|
||||
static Optional<Color> parse_rgb_color(const StringView& string)
|
||||
|
||||
Reference in New Issue
Block a user