Skip to content

Commit

Permalink
ImGui: Applied tweaks to default styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemony committed Feb 26, 2024
1 parent 85d9859 commit 8082f91
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 7 deletions.
47 changes: 40 additions & 7 deletions src/imgui/imgui_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_TitleBgActive] = ImVec4(0.16f, 0.29f, 0.48f, 1.00f);
colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f);
colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f);
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.02f, 0.02f, 0.02f, 0.00f); // 0.53f
colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
Expand All @@ -206,7 +206,7 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_Separator] = colors[ImGuiCol_Border];
colors[ImGuiCol_SeparatorHovered] = ImVec4(0.10f, 0.40f, 0.75f, 0.78f);
colors[ImGuiCol_SeparatorActive] = ImVec4(0.10f, 0.40f, 0.75f, 1.00f);
colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.20f);
colors[ImGuiCol_ResizeGrip] = ImVec4(0.26f, 0.59f, 0.98f, 0.25f);
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
Expand All @@ -229,8 +229,19 @@ void ImGui::StyleColorsDark(ImGuiStyle* dst)
colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.50f); // ImVec4(0.80f, 0.80f, 0.80f, 0.20f)
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.50f); // ImVec4(0.80f, 0.80f, 0.80f, 0.35f);

// Custom
colors[ImGuiCol_SKIF_TextBase] = colors[ImGuiCol_Text];
colors[ImGuiCol_SKIF_TextCaption] = colors[ImGuiCol_CheckMark];
colors[ImGuiCol_SKIF_TextGameTitle] = colors[ImGuiCol_Text];
colors[ImGuiCol_SKIF_Success] = ImColor(121, 214, 28); // ImColor(144, 238, 144);
colors[ImGuiCol_SKIF_Warning] = ImColor(255, 124, 3); // ImColor::HSV(0.11F, 1.F, 1.F)
colors[ImGuiCol_SKIF_Failure] = ImColor(186, 59, 61, 255);
colors[ImGuiCol_SKIF_Info] = ImColor::HSV(0.55F, 0.99F, 1.F);
colors[ImGuiCol_SKIF_Yellow] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Icon] = colors[ImGuiCol_Text];
}

void ImGui::StyleColorsClassic(ImGuiStyle* dst)
Expand All @@ -240,7 +251,7 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)

colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.85f);
colors[ImGuiCol_WindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f);
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_PopupBg] = ImVec4(0.11f, 0.11f, 0.14f, 0.92f);
colors[ImGuiCol_Border] = ImVec4(0.50f, 0.50f, 0.50f, 0.50f);
Expand All @@ -252,7 +263,7 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_TitleBgActive] = ImVec4(0.32f, 0.32f, 0.63f, 0.87f);
colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.40f, 0.40f, 0.80f, 0.20f);
colors[ImGuiCol_MenuBarBg] = ImVec4(0.40f, 0.40f, 0.55f, 0.80f);
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f);
colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.00f); // 0.60f
colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.80f, 0.30f);
colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.80f, 0.40f);
colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.41f, 0.39f, 0.80f, 0.60f);
Expand All @@ -268,7 +279,7 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 0.60f);
colors[ImGuiCol_SeparatorHovered] = ImVec4(0.60f, 0.60f, 0.70f, 1.00f);
colors[ImGuiCol_SeparatorActive] = ImVec4(0.70f, 0.70f, 0.90f, 1.00f);
colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.16f);
colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.78f, 0.82f, 1.00f, 0.60f);
colors[ImGuiCol_ResizeGripActive] = ImVec4(0.78f, 0.82f, 1.00f, 0.90f);
colors[ImGuiCol_Tab] = ImLerp(colors[ImGuiCol_Header], colors[ImGuiCol_TitleBgActive], 0.80f);
Expand All @@ -293,6 +304,17 @@ void ImGui::StyleColorsClassic(ImGuiStyle* dst)
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);

// Custom
colors[ImGuiCol_SKIF_TextBase] = colors[ImGuiCol_Text];
colors[ImGuiCol_SKIF_TextCaption] = colors[ImGuiCol_HeaderActive];
colors[ImGuiCol_SKIF_TextGameTitle] = colors[ImGuiCol_Text];
colors[ImGuiCol_SKIF_Success] = ImColor(144, 238, 144);
colors[ImGuiCol_SKIF_Warning] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Failure] = ImColor(186, 59, 61, 255);
colors[ImGuiCol_SKIF_Info] = ImColor::HSV(0.55F, 0.99F, 1.F);
colors[ImGuiCol_SKIF_Yellow] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Icon] = colors[ImGuiCol_Text];
}

// Those light colors are better suited with a thicker font than the default one + FrameBorder
Expand Down Expand Up @@ -356,6 +378,17 @@ void ImGui::StyleColorsLight(ImGuiStyle* dst)
colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f);
colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.20f);
colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);

// Custom
colors[ImGuiCol_SKIF_TextBase] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
colors[ImGuiCol_SKIF_TextCaption] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
colors[ImGuiCol_SKIF_TextGameTitle] = colors[ImGuiCol_Text];
colors[ImGuiCol_SKIF_Success] = ImColor(86, 168, 64); //144, 238, 144) * ImVec4(0.8f, 0.8f, 0.8f, 1.0f);
colors[ImGuiCol_SKIF_Warning] = ImColor(240, 139, 24); // ImColor::HSV(0.11F, 1.F, 1.F)
colors[ImGuiCol_SKIF_Failure] = ImColor(186, 59, 61, 255);
colors[ImGuiCol_SKIF_Info] = colors[ImGuiCol_CheckMark];
colors[ImGuiCol_SKIF_Yellow] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Icon] = colors[ImGuiCol_Text];
}

//-----------------------------------------------------------------------------
Expand Down
16 changes: 16 additions & 0 deletions src/utility/skif_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ SKIF_ImGui_StyleColorsDark (ImGuiStyle* dst)
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);

// Tables
colors[ImGuiCol_TableHeaderBg] = ImVec4(0.19f, 0.19f, 0.20f, 1.00f);
colors[ImGuiCol_TableBorderStrong] = ImVec4(0.31f, 0.31f, 0.35f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);

// Drag-n-drop
colors[ImGuiCol_DragDropTarget] = ImVec4(0.90f, 0.90f, 0.10f, 1.00f);

Expand All @@ -178,6 +185,7 @@ SKIF_ImGui_StyleColorsDark (ImGuiStyle* dst)
colors[ImGuiCol_SKIF_Failure] = ImColor(186, 59, 61, 255);
colors[ImGuiCol_SKIF_Info] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); // colors[ImGuiCol_CheckMark];
colors[ImGuiCol_SKIF_Yellow] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Icon] = colors[ImGuiCol_Text];
}

void
Expand Down Expand Up @@ -263,6 +271,13 @@ SKIF_ImGui_StyleColorsLight (ImGuiStyle* dst)
colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.45f, 0.00f, 1.00f);

// Tables
colors[ImGuiCol_TableHeaderBg] = ImVec4(0.78f, 0.87f, 0.98f, 1.00f);
colors[ImGuiCol_TableBorderStrong] = ImVec4(0.57f, 0.57f, 0.64f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableBorderLight] = ImVec4(0.68f, 0.68f, 0.74f, 1.00f); // Prefer using Alpha=1.0 here
colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_TableRowBgAlt] = ImVec4(0.30f, 0.30f, 0.30f, 0.09f);

// Drag-n-drop
colors[ImGuiCol_DragDropTarget] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);

Expand All @@ -281,6 +296,7 @@ SKIF_ImGui_StyleColorsLight (ImGuiStyle* dst)
colors[ImGuiCol_SKIF_Failure] = ImColor(186, 59, 61, 255);
colors[ImGuiCol_SKIF_Info] = colors[ImGuiCol_CheckMark];
colors[ImGuiCol_SKIF_Yellow] = ImColor::HSV(0.11F, 1.F, 1.F);
colors[ImGuiCol_SKIF_Icon] = colors[ImGuiCol_Text];
}

void
Expand Down

0 comments on commit 8082f91

Please sign in to comment.