ImGuiAl Logger integration: introduction and acknownledgement #72
Replies: 3 comments
-
Hey, ImGuiAl author here :) I couldn't find it in the repository, I'd love to update my repository with the changes to use colors computed automatically. Was it removed from imgui_bundle? |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for contacting me! First of all, sorry for not having contacted you directly sooner, and for not having had time to send you a PR :-) Actually, I am using ImGuiAl inside HelloImGui, which is a dependency of Dear ImGui Bundle. HelloImGui was developed two years before ImGui Bundle. I'm only using the logger (through imguial_term), and HelloImGui provides an API for it. So, to answer your question, this commit in HelloImGui added automatic colors. Basically, it computes colors in the
ImU32 makeColor(LogColorClass logColorClass, LogColorState logColorState, float windowBgHsv_Value)
{
float wantedHue = logColorClassHue(logColorClass, logColorState);
float adaptedValue = 1.f;
if (windowBgHsv_Value < 0.8f)
adaptedValue = 0.9f;
else
adaptedValue = 0.6f;
float resultHsv[3] = { wantedHue, 1.f, adaptedValue };
float resultRgb[3];
ImGui::ColorConvertHSVtoRGB(resultHsv[0], resultHsv[1], resultHsv[2], resultRgb[0], resultRgb[1], resultRgb[2]);
ImVec4 r { resultRgb[0], resultRgb[1], resultRgb[2], 1.f };
return ImGui::GetColorU32(r);
} And here is the result on different backgrounds: Also, I make sure that the text color on the filter buttons is constant (and as you can see the text color on the red error button could still be improved) I just created a PR to help you if you want to integrate this. I could not test that it compiles and works well on your repository since I did not recreate a working environment for compiling it. |
Beta Was this translation helpful? Give feedback.
-
No problem!
Ah thanks a bunch! I'll check it out. |
Beta Was this translation helpful? Give feedback.
-
ImGuiAl provides several ImGui widgets.
Amongst them, HelloImGui uses the logger that came with it.
Online emscripten demo
Beta Was this translation helpful? Give feedback.
All reactions