aboutsummaryrefslogtreecommitdiff
path: root/include/cru/platform
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-10-19 22:33:01 +0800
committercrupest <crupest@outlook.com>2021-10-19 22:33:01 +0800
commitfd2e84640b2be52f97f48d818d26fc1289a50c7a (patch)
treeab94a27fae4b4bb47a6124a478b20c82a1393b9b /include/cru/platform
parent44f24f8ece48fd4acc2e8d5f5a052cbc1981768c (diff)
downloadcru-fd2e84640b2be52f97f48d818d26fc1289a50c7a.tar.gz
cru-fd2e84640b2be52f97f48d818d26fc1289a50c7a.tar.bz2
cru-fd2e84640b2be52f97f48d818d26fc1289a50c7a.zip
...
Diffstat (limited to 'include/cru/platform')
-rw-r--r--include/cru/platform/Color.hpp5
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