From 168817476f85e8dbc04c06691a73a7d75c4858d5 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 10 Mar 2022 21:17:17 +0800 Subject: ... --- include/cru/platform/Color.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/cru/platform/Color.h b/include/cru/platform/Color.h index 4e35ae63..2e8c0ebe 100644 --- a/include/cru/platform/Color.h +++ b/include/cru/platform/Color.h @@ -2,8 +2,8 @@ #include "cru/common/Base.h" #include "cru/platform/Base.h" -#include "cru/common/String.h" #include "cru/common/Format.h" +#include "cru/common/String.h" #include #include @@ -262,4 +262,18 @@ inline String ToString(const Color& color) { return cru::Format(u"rgba({}, {}, {}, {})", color.red, color.green, color.blue, color.alpha); } + +struct CRU_PLATFORM_API HslColor { + HslColor() = default; + HslColor(float h, float s, float l, float a = 1.0f) + : h(h), s(s), l(l), a(a) {} + HslColor(const Color& rgb); + + operator Color() const; + + float h; + float s; + float l; + float a; +}; } // namespace cru::platform -- cgit v1.2.3