diff options
author | crupest <crupest@outlook.com> | 2022-03-10 21:17:17 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-03-10 21:17:17 +0800 |
commit | 168817476f85e8dbc04c06691a73a7d75c4858d5 (patch) | |
tree | 1c32d53c75bf4305a39423c51e5f4c92deba0ecc /include | |
parent | a9558215aef3b0ad67dc73788305e1b46bc872b5 (diff) | |
download | cru-168817476f85e8dbc04c06691a73a7d75c4858d5.tar.gz cru-168817476f85e8dbc04c06691a73a7d75c4858d5.tar.bz2 cru-168817476f85e8dbc04c06691a73a7d75c4858d5.zip |
...
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/platform/Color.h | 16 |
1 files changed, 15 insertions, 1 deletions
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 <cstdint> #include <optional> @@ -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 |