diff options
Diffstat (limited to 'include/cru/platform')
-rw-r--r-- | include/cru/platform/Color.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/platform/Color.hpp b/include/cru/platform/Color.hpp index 3a72aa65..f60ab692 100644 --- a/include/cru/platform/Color.hpp +++ b/include/cru/platform/Color.hpp @@ -257,4 +257,9 @@ extern const std::unordered_map<StringView, Color> predefined_name_color_map; } // namespace details std::optional<Color> GetPredefinedColorByName(StringView name); + +inline String ToString(const Color& color) { + return cru::Format(u"rgba({}, {}, {}, {})", color.red, color.green, + color.blue, color.alpha); +} } // namespace cru::platform |