impr: Allow all highlights to overlap each other

This commit is contained in:
WerWolv
2025-01-04 21:40:03 +01:00
parent c56af08c7e
commit 6e861001cf
5 changed files with 26 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
#include <hex/providers/buffered_reader.hpp>
#include <imgui.h>
#include <imgui_internal.h>
#if defined(OS_WINDOWS)
#include <windows.h>
@@ -844,4 +845,15 @@ namespace hex {
#endif
}
std::optional<ImColor> blendColors(const std::optional<ImColor> &a, const std::optional<ImColor> &b) {
if (!a.has_value() && !b.has_value())
return std::nullopt;
else if (a.has_value() && !b.has_value())
return a;
else if (!a.has_value() && b.has_value())
return b;
else
return ImAlphaBlendColors(a.value(), b.value());
}
}