1
0
mirror of synced 2024-11-28 09:30:51 +01:00

impr: Better highlighting color when hovering over colors in the theme manager

This commit is contained in:
WerWolv 2023-11-16 13:23:47 +01:00
parent 21057d51e1
commit 1331b0691f

View File

@ -30,6 +30,12 @@ namespace hex::plugin::builtin {
// Loop over all the individual theme settings
for (auto &[colorName, colorId] : handler.colorMap) {
if (this->m_startingColor.has_value()) {
if (this->m_hoveredColorId == colorId && this->m_hoveredHandlerName == name) {
handler.setFunction(colorId, this->m_startingColor.value());
}
}
// Get the current color value
auto color = handler.getFunction(colorId);
@ -56,8 +62,10 @@ namespace hex::plugin::builtin {
auto flashingColor = this->m_startingColor.value();
const float flashProgress = std::min(1.0F, (1.0F + sinf(ImGui::GetTime() * 6)) / 2.0F);
flashingColor.Value.x = std::lerp(flashingColor.Value.x, 1.0F, flashProgress);
flashingColor.Value.y = std::lerp(flashingColor.Value.y, 1.0F, flashProgress);;
flashingColor.Value.x = std::lerp(flashingColor.Value.x / 2, 1.0F, flashProgress);
flashingColor.Value.y = std::lerp(flashingColor.Value.y / 2, 1.0F, flashProgress);
flashingColor.Value.z = flashingColor.Value.z / 2;
flashingColor.Value.w = 1.0F;
handler.setFunction(*this->m_hoveredColorId, flashingColor);