diff --git a/launcher/src/ui/color.cpp b/launcher/src/ui/color.cpp index 5c04d87f2e..ba71d2fdb9 100644 --- a/launcher/src/ui/color.cpp +++ b/launcher/src/ui/color.cpp @@ -27,7 +27,57 @@ static ImVec4 blend_color(const ImVec4 &top, const ImVec4 &bottom) { out.w = bottom.w; return out; } -ImVec4 Frame::blend_with_primary(const ImVec4 &color) { +static ImVec4 blend_with_primary(const ImVec4 &color) { static constexpr ImVec4 primary_color = {1.0f, (69.0f / 255.0f), 0.0f, 1.0f}; return blend_color(primary_color, color); +} + +// Modify Colors +void Frame::patch_colors(ImGuiStyle &style) { + // Blend Colors + static int target_colors_blend[] = { + ImGuiCol_FrameBg, + ImGuiCol_FrameBgHovered, + ImGuiCol_FrameBgActive, + ImGuiCol_TitleBgActive, + ImGuiCol_CheckMark, + ImGuiCol_SliderGrab, + ImGuiCol_SliderGrabActive, + ImGuiCol_Button, + ImGuiCol_ButtonHovered, + ImGuiCol_ButtonActive, + ImGuiCol_Header, + ImGuiCol_HeaderHovered, + ImGuiCol_HeaderActive, + ImGuiCol_SeparatorHovered, + ImGuiCol_SeparatorActive, + ImGuiCol_ResizeGrip, + ImGuiCol_ResizeGripHovered, + ImGuiCol_ResizeGripActive, + ImGuiCol_TabHovered, + ImGuiCol_Tab, + ImGuiCol_TabSelected, + ImGuiCol_TabSelectedOverline, + ImGuiCol_TabDimmed, + ImGuiCol_TabDimmedSelected, + ImGuiCol_TextLink, + ImGuiCol_TextSelectedBg, + ImGuiCol_NavCursor + }; + for (const int target_color : target_colors_blend) { + ImVec4 &color = style.Colors[target_color]; + color = blend_with_primary(color); + } + // Remove Blue Accent From Colors + static int target_colors_modify[] = { + ImGuiCol_Separator, + ImGuiCol_Border, + ImGuiCol_TableHeaderBg, + ImGuiCol_TableBorderStrong, + ImGuiCol_TableBorderLight + }; + for (const int target_color : target_colors_modify) { + ImVec4 &color = style.Colors[target_color]; + color.z = color.x; + } } \ No newline at end of file diff --git a/launcher/src/ui/frame.cpp b/launcher/src/ui/frame.cpp index 352cb13c70..551aa54b21 100644 --- a/launcher/src/ui/frame.cpp +++ b/launcher/src/ui/frame.cpp @@ -86,42 +86,5 @@ void Frame::setup_style(const float scale) { style.WindowBorderSize = 0; ImGui::StyleColorsDark(&style); style.ScaleAllSizes(scale); - // Blend Colors - static int target_colors[] = { - ImGuiCol_FrameBg, - ImGuiCol_FrameBgHovered, - ImGuiCol_FrameBgActive, - ImGuiCol_TitleBgActive, - ImGuiCol_CheckMark, - ImGuiCol_SliderGrab, - ImGuiCol_SliderGrabActive, - ImGuiCol_Button, - ImGuiCol_ButtonHovered, - ImGuiCol_ButtonActive, - ImGuiCol_Header, - ImGuiCol_HeaderHovered, - ImGuiCol_HeaderActive, - ImGuiCol_Separator, - ImGuiCol_SeparatorHovered, - ImGuiCol_SeparatorActive, - ImGuiCol_ResizeGrip, - ImGuiCol_ResizeGripHovered, - ImGuiCol_ResizeGripActive, - ImGuiCol_TabHovered, - ImGuiCol_Tab, - ImGuiCol_TabSelected, - ImGuiCol_TabSelectedOverline, - ImGuiCol_TabDimmed, - ImGuiCol_TabDimmedSelected, - ImGuiCol_TextLink, - ImGuiCol_TextSelectedBg, - ImGuiCol_NavCursor - }; - for (const int target_color : target_colors) { - ImVec4 &color = style.Colors[target_color]; - color = blend_with_primary(color); - } - // Update Border Color - ImVec4 &border_color = style.Colors[ImGuiCol_Border]; - border_color.z = border_color.x; + patch_colors(style); } diff --git a/launcher/src/ui/frame.h b/launcher/src/ui/frame.h index a2dbcfa1bb..1d5fbd0f1a 100644 --- a/launcher/src/ui/frame.h +++ b/launcher/src/ui/frame.h @@ -19,5 +19,5 @@ private: // Internal float get_scale(); void setup_style(float scale); - static ImVec4 blend_with_primary(const ImVec4 &color); + static void patch_colors(ImGuiStyle &style); }; \ No newline at end of file