diff options
Diffstat (limited to 'Libraries/LibGfx/Color.cpp')
-rw-r--r-- | Libraries/LibGfx/Color.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibGfx/Color.cpp b/Libraries/LibGfx/Color.cpp index 01bb3988d4..1e6d888f95 100644 --- a/Libraries/LibGfx/Color.cpp +++ b/Libraries/LibGfx/Color.cpp @@ -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) |