From fd2e84640b2be52f97f48d818d26fc1289a50c7a Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 19 Oct 2021 22:33:01 +0800 Subject: ... --- include/cru/platform/Color.hpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/cru/platform') 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 predefined_name_color_map; } // namespace details std::optional 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 -- cgit v1.2.3