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:
parent
c24d4b07db
commit
f4b8e4966f
2 changed files with 8 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue