1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

SharedGraphics: Add Color::to_string().

This generates a string in the format "rgba(%d, %d, %d, %d)".
This commit is contained in:
Andreas Kling 2019-03-18 04:53:09 +01:00
parent c24d4b07db
commit f4b8e4966f
2 changed files with 8 additions and 0 deletions

View file

@ -25,3 +25,8 @@ Color::Color(NamedColor named)
m_value = 0xff000000 | (rgb.r << 16) | (rgb.g << 8) | rgb.b;
}
String Color::to_string() const
{
return String::format("rgba(%d, %d, %d, %d)", red(), green(), blue(), alpha());
}