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; return hue;
} }
void change_accent_color(ImVec4 &color, float hue) { void change_accent_color(ImVec4 &color, float hue) {
//ImGuiStyle& style = ImGui::GetStyle();
//ImVec4 in = style.Colors[color];
ImVec4 in = color; ImVec4 in = color;
float Target = hue; float Target = hue;
float Current = GetHue(in); float Current = GetHue(in);
if (Current < 0.0f) { if (Current < 0.0f) {
return; return;
} }
float H = 360-Target+Current; // TODO: Figure out why these magic numbers are necessary. float H = 360-Target+Current;
//printf("Cur: %f, Target: %f, Diff: %f", Current, Target, H);
float U = cos(H*pi/180.0); float U = cos(H*pi/180.0);
float W = sin(H*pi/180.0); float W = sin(H*pi/180.0);
ImVec4 out = in; 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 out.z = (.299-.3*U+1.25*W)*in.x
+ (.587-.588*U-1.05*W)*in.y + (.587-.588*U-1.05*W)*in.y
+ (.114+.886*U-.203*W)*in.z; + (.114+.886*U-.203*W)*in.z;
//printf(", Actual: %f\n", GetHue(out));
color = out; color = out;
} }
@ -82,46 +78,10 @@ void UpdateStyle(bool dark) {
ImGui::StyleColorsDark(); ImGui::StyleColorsDark();
} else { } else {
ImGui::StyleColorsLight(); 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) { for (auto& color : ImGui::GetStyle().Colors) {
change_accent_color(color, accent_color); change_accent_color(color, accent_color);
}/*
if (dark) {
for (auto color : colors_dark) {
change_accent_color(color, accent_color);
} }
}*/
} }
// Main code // Main code
int main(int, char**) int main(int, char**)