From bdee9dd0c92865e0cec2f4bbf170959df282a930 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 11 Jun 2021 22:19:23 -0700 Subject: More UI polishing and fix asset saving/reloading --- core/src/Utils/Color.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/src/Utils') diff --git a/core/src/Utils/Color.hpp b/core/src/Utils/Color.hpp index 46435c3..19227e0 100644 --- a/core/src/Utils/Color.hpp +++ b/core/src/Utils/Color.hpp @@ -115,6 +115,16 @@ public: return ImColor{ v.x, v.y, v.z, v.w }; } + ImU32 AsImU32() const + { + ImU32 res; + res |= r << IM_COL32_R_SHIFT; + res |= g << IM_COL32_G_SHIFT; + res |= b << IM_COL32_B_SHIFT; + res |= a << IM_COL32_A_SHIFT; + return res; + } + constexpr void SetVec(const Vec4f& vec) noexcept { r = (uint8_t)(vec.x * 255.0f); -- cgit v1.2.3-70-g09d2