FSUI: Switch Secondary Light/Dark colors with Strong/Weak

Strong has higher than contrast against the background than the base color (lighter on dark theme, darker on light theme), weak is the opposite.
Previously the light color increased contrast in dark themes, but descreased contrast in light themes, which meant it wasn't suitable for the same things in the respective themes
This commit is contained in:
TellowKrinkle 2023-07-16 19:41:18 -05:00 committed by TellowKrinkle
parent 7ca726492f
commit 19d8b59ca7
3 changed files with 14 additions and 14 deletions

View File

@ -85,8 +85,8 @@ using ImGuiFullscreen::UIPrimaryLightColor;
using ImGuiFullscreen::UIPrimaryLineColor;
using ImGuiFullscreen::UIPrimaryTextColor;
using ImGuiFullscreen::UISecondaryColor;
using ImGuiFullscreen::UISecondaryDarkColor;
using ImGuiFullscreen::UISecondaryLightColor;
using ImGuiFullscreen::UISecondaryWeakColor;
using ImGuiFullscreen::UISecondaryStrongColor;
using ImGuiFullscreen::UISecondaryTextColor;
using ImGuiFullscreen::UITextHighlightColor;

View File

@ -83,8 +83,8 @@ namespace ImGuiFullscreen
ImVec4 UITextHighlightColor;
ImVec4 UIPrimaryLineColor;
ImVec4 UISecondaryColor;
ImVec4 UISecondaryLightColor;
ImVec4 UISecondaryDarkColor;
ImVec4 UISecondaryStrongColor;
ImVec4 UISecondaryWeakColor;
ImVec4 UISecondaryTextColor;
static u32 s_menu_button_index = 0;
@ -1144,7 +1144,7 @@ bool ImGuiFullscreen::ToggleButton(
}
else
{
col_bg = ImGui::GetColorU32(ImLerp(HEX_TO_IMVEC4(0x8C8C8C, 0xff), UISecondaryLightColor, t));
col_bg = ImGui::GetColorU32(ImLerp(HEX_TO_IMVEC4(0x8C8C8C, 0xff), UISecondaryStrongColor, t));
col_knob = IM_COL32(255, 255, 255, 255);
}
@ -1220,10 +1220,10 @@ bool ImGuiFullscreen::ThreeWayToggleButton(
col_bg = IM_COL32(0x75, 0x75, 0x75, 0xff);
else if (hovered)
col_bg = ImGui::GetColorU32(
ImLerp(v->has_value() ? HEX_TO_IMVEC4(0xf05100, 0xff) : HEX_TO_IMVEC4(0x9e9e9e, 0xff), UISecondaryLightColor, color_t));
ImLerp(v->has_value() ? HEX_TO_IMVEC4(0xf05100, 0xff) : HEX_TO_IMVEC4(0x9e9e9e, 0xff), UISecondaryStrongColor, color_t));
else
col_bg = ImGui::GetColorU32(
ImLerp(v->has_value() ? HEX_TO_IMVEC4(0xc45100, 0xff) : HEX_TO_IMVEC4(0x757575, 0xff), UISecondaryLightColor, color_t));
ImLerp(v->has_value() ? HEX_TO_IMVEC4(0xc45100, 0xff) : HEX_TO_IMVEC4(0x757575, 0xff), UISecondaryStrongColor, color_t));
dl->AddRectFilled(toggle_pos, ImVec2(toggle_pos.x + toggle_width, toggle_pos.y + toggle_height), col_bg, toggle_height * 0.5f);
dl->AddCircleFilled(ImVec2(toggle_pos.x + toggle_radius + t * (toggle_width - toggle_radius * 2.0f), toggle_pos.y + toggle_radius),
@ -2219,7 +2219,7 @@ void ImGuiFullscreen::DrawBackgroundProgressDialogs(ImVec2& position, float spac
const float window_height = LayoutScale(75.0f);
ImGui::PushStyleColor(ImGuiCol_WindowBg, UIPrimaryDarkColor);
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, UISecondaryLightColor);
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, UISecondaryStrongColor);
ImGui::PushStyleVar(ImGuiStyleVar_PopupRounding, LayoutScale(4.0f));
ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, LayoutScale(1.0f));
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(10.0f, 10.0f));
@ -2479,8 +2479,8 @@ void ImGuiFullscreen::SetTheme(bool light)
UITextHighlightColor = HEX_TO_IMVEC4(0x90caf9, 0xff);
UIPrimaryLineColor = HEX_TO_IMVEC4(0xffffff, 0xff);
UISecondaryColor = HEX_TO_IMVEC4(0x0d47a1, 0xff);
UISecondaryLightColor = HEX_TO_IMVEC4(0x63a4ff, 0xff);
UISecondaryDarkColor = HEX_TO_IMVEC4(0x002171, 0xff);
UISecondaryStrongColor = HEX_TO_IMVEC4(0x63a4ff, 0xff);
UISecondaryWeakColor = HEX_TO_IMVEC4(0x002171, 0xff);
UISecondaryTextColor = HEX_TO_IMVEC4(0xffffff, 0xff);
}
else
@ -2498,8 +2498,8 @@ void ImGuiFullscreen::SetTheme(bool light)
UITextHighlightColor = HEX_TO_IMVEC4(0x8e8e8e, 0xff);
UIPrimaryLineColor = HEX_TO_IMVEC4(0x000000, 0xff);
UISecondaryColor = HEX_TO_IMVEC4(0x3d5afe, 0xff);
UISecondaryLightColor = HEX_TO_IMVEC4(0xc0cfff, 0xff);
UISecondaryDarkColor = HEX_TO_IMVEC4(0x0031ca, 0xff);
UISecondaryStrongColor = HEX_TO_IMVEC4(0x0031ca, 0xff);
UISecondaryWeakColor = HEX_TO_IMVEC4(0xc0cfff, 0xff);
UISecondaryTextColor = HEX_TO_IMVEC4(0x000000, 0xff);
}
}

View File

@ -63,8 +63,8 @@ namespace ImGuiFullscreen
extern ImVec4 UITextHighlightColor;
extern ImVec4 UIPrimaryLineColor;
extern ImVec4 UISecondaryColor;
extern ImVec4 UISecondaryLightColor;
extern ImVec4 UISecondaryDarkColor;
extern ImVec4 UISecondaryStrongColor;
extern ImVec4 UISecondaryWeakColor;
extern ImVec4 UISecondaryTextColor;
static __fi float DPIScale(float v) { return ImGui::GetIO().DisplayFramebufferScale.x * v; }