From 6430e460887e6082e97b8b720fb6777a11a5bfec Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 4 Jun 2023 03:50:18 -0700 Subject: [PATCH] Remove some unnecessary commented out code. --- main.cpp | 46 +++------------------------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/main.cpp b/main.cpp index d05bae4..4c5113b 100644 --- a/main.cpp +++ b/main.cpp @@ -51,16 +51,13 @@ float GetHue(ImVec4 rgba){ return hue; } void change_accent_color(ImVec4 &color, float hue) { - //ImGuiStyle& style = ImGui::GetStyle(); - //ImVec4 in = style.Colors[color]; ImVec4 in = color; float Target = hue; float Current = GetHue(in); if (Current < 0.0f) { return; } - float H = 360-Target+Current; // TODO: Figure out why these magic numbers are necessary. - //printf("Cur: %f, Target: %f, Diff: %f", Current, Target, H); + float H = 360-Target+Current; float U = cos(H*pi/180.0); float W = sin(H*pi/180.0); ImVec4 out = in; @@ -73,7 +70,6 @@ void change_accent_color(ImVec4 &color, float hue) { out.z = (.299-.3*U+1.25*W)*in.x + (.587-.588*U-1.05*W)*in.y + (.114+.886*U-.203*W)*in.z; - //printf(", Actual: %f\n", GetHue(out)); color = out; } @@ -82,46 +78,10 @@ void UpdateStyle(bool dark) { ImGui::StyleColorsDark(); } else { ImGui::StyleColorsLight(); - }/* - ImGuiCol colors[] = { - ImGuiCol_FrameBgHovered, - ImGuiCol_FrameBgActive, - ImGuiCol_CheckMark, - ImGuiCol_SliderGrab, - ImGuiCol_SliderGrabActive, - ImGuiCol_Button, - ImGuiCol_ButtonHovered, - ImGuiCol_ButtonActive, - ImGuiCol_Header, - ImGuiCol_HeaderHovered, - ImGuiCol_HeaderActive, - ImGuiCol_ResizeGripActive, - ImGuiCol_ResizeGripHovered, - ImGuiCol_Tab, - ImGuiCol_TabHovered, - ImGuiCol_TabActive, - ImGuiCol_TabUnfocusedActive, - ImGuiCol_DockingPreview, - ImGuiCol_TableHeaderBg, - ImGuiCol_TextSelectedBg, - ImGuiCol_DragDropTarget, - ImGuiCol_SeparatorHovered, - ImGuiCol_SeparatorActive, - ImGuiCol_NavHighlight, - }; - ImGuiCol colors_dark[] = { - ImGuiCol_FrameBg, - ImGuiCol_TitleBgActive, - ImGuiCol_ResizeGrip, - };*/ + } for (auto& color : ImGui::GetStyle().Colors) { change_accent_color(color, accent_color); - }/* - if (dark) { - for (auto color : colors_dark) { - change_accent_color(color, accent_color); - } - }*/ + } } // Main code int main(int, char**)