Remove some unnecessary commented out code.

This commit is contained in:
Zachary Hall 2023-06-04 03:50:18 -07:00
parent 6e1b451a9c
commit 6430e46088

View file

@ -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**)