summaryrefslogtreecommitdiff
path: root/core/src/Utils
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-06-11 22:19:23 -0700
committerrtk0c <[email protected]>2021-06-11 22:19:23 -0700
commitbdee9dd0c92865e0cec2f4bbf170959df282a930 (patch)
treeaf9d40cb4378ee2166574faed9cc16e283110f31 /core/src/Utils
parent8f7daa9bd100345d7e23639604c9a3a50ce6448b (diff)
More UI polishing and fix asset saving/reloading
Diffstat (limited to 'core/src/Utils')
-rw-r--r--core/src/Utils/Color.hpp10
1 files changed, 10 insertions, 0 deletions
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);