From 201021092d204680b353c82ce9e9beb76f3044e8 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Mon, 20 Sep 2021 11:35:24 +0300 Subject: Accent color consistency The alt accent color should be used as sparingly as possible for maximum effect. The user's chosen accent color should be predominant in the UI. --- src/ui/color.c | 33 +++++++++++++++++---------------- src/ui/labelwidget.c | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/ui/color.c b/src/ui/color.c index 656de6f0..e6ed7515 100644 --- a/src/ui/color.c +++ b/src/ui/color.c @@ -85,6 +85,7 @@ void setThemePalette_Color(enum iColorTheme theme) { const int accentLo = (prefs->accent == cyan_ColorAccent ? teal_ColorId : brown_ColorId); const int altAccentHi = (prefs->accent == cyan_ColorAccent ? orange_ColorId : cyan_ColorId); const int altAccentLo = (prefs->accent == cyan_ColorAccent ? brown_ColorId : teal_ColorId); + const iColor accentMid = mix_Color(get_Color(accentHi), get_Color(accentLo), 0.5f); const iColor altAccentMid = mix_Color(get_Color(altAccentHi), get_Color(altAccentLo), 0.5f); switch (theme) { case pureBlack_ColorTheme: { @@ -124,16 +125,16 @@ void setThemePalette_Color(enum iColorTheme theme) { copy_(uiInputTextFocused_ColorId, white_ColorId); copy_(uiInputFrame_ColorId, gray25_ColorId); copy_(uiInputFrameHover_ColorId, accentHi); - set_Color(uiInputFrameFocused_ColorId, altAccentMid); - copy_(uiInputCursor_ColorId, altAccentHi); + copy_(uiInputFrameFocused_ColorId, accentLo); + copy_(uiInputCursor_ColorId, accentHi); copy_(uiInputCursorText_ColorId, black_ColorId); copy_(uiHeading_ColorId, accentHi); copy_(uiAnnotation_ColorId, accentLo); copy_(uiIcon_ColorId, accentHi); copy_(uiIconHover_ColorId, accentHi); copy_(uiSeparator_ColorId, gray25_ColorId); - copy_(uiMarked_ColorId, altAccentLo); - copy_(uiMatching_ColorId, accentLo); + copy_(uiMarked_ColorId, accentLo); + copy_(uiMatching_ColorId, altAccentLo); break; } default: @@ -177,16 +178,16 @@ void setThemePalette_Color(enum iColorTheme theme) { get_Color(altAccentHi), 0.15f)); copy_(uiInputFrame_ColorId, uiInputBackground_ColorId); copy_(uiInputFrameHover_ColorId, accentHi); - set_Color(uiInputFrameFocused_ColorId, altAccentMid); - copy_(uiInputCursor_ColorId, altAccentHi); + copy_(uiInputFrameFocused_ColorId, accentLo); + copy_(uiInputCursor_ColorId, accentHi); copy_(uiInputCursorText_ColorId, black_ColorId); copy_(uiHeading_ColorId, accentHi); copy_(uiAnnotation_ColorId, accentLo); copy_(uiIcon_ColorId, accentHi); copy_(uiIconHover_ColorId, accentHi); copy_(uiSeparator_ColorId, black_ColorId); - copy_(uiMarked_ColorId, altAccentLo); - copy_(uiMatching_ColorId, accentLo); + copy_(uiMarked_ColorId, accentLo); + copy_(uiMatching_ColorId, altAccentLo); break; } case light_ColorTheme: @@ -227,8 +228,8 @@ void setThemePalette_Color(enum iColorTheme theme) { set_Color(uiInputFrame_ColorId, mix_Color(get_Color(gray50_ColorId), get_Color(gray75_ColorId), 0.5f)); copy_(uiInputFrameHover_ColorId, accentLo); - copy_(uiInputFrameFocused_ColorId, altAccentLo); - copy_(uiInputCursor_ColorId, altAccentLo); + copy_(uiInputFrameFocused_ColorId, accentLo); + copy_(uiInputCursor_ColorId, accentLo); copy_(uiInputCursorText_ColorId, white_ColorId); copy_(uiHeading_ColorId, accentLo); copy_(uiAnnotation_ColorId, gray50_ColorId); @@ -236,8 +237,8 @@ void setThemePalette_Color(enum iColorTheme theme) { copy_(uiIconHover_ColorId, accentLo); set_Color(uiSeparator_ColorId, mix_Color(get_Color(gray50_ColorId), get_Color(gray75_ColorId), 0.5f)); - copy_(uiMarked_ColorId, altAccentHi); - copy_(uiMatching_ColorId, accentHi); + copy_(uiMarked_ColorId, accentHi); + copy_(uiMatching_ColorId, altAccentHi); break; case pureWhite_ColorTheme: copy_(uiBackground_ColorId, white_ColorId); @@ -278,8 +279,8 @@ void setThemePalette_Color(enum iColorTheme theme) { copy_(uiInputTextFocused_ColorId, black_ColorId); copy_(uiInputFrame_ColorId, gray50_ColorId); copy_(uiInputFrameHover_ColorId, accentLo); - copy_(uiInputFrameFocused_ColorId, altAccentLo); - copy_(uiInputCursor_ColorId, altAccentLo); + copy_(uiInputFrameFocused_ColorId, accentLo); + copy_(uiInputCursor_ColorId, accentLo); copy_(uiInputCursorText_ColorId, white_ColorId); copy_(uiHeading_ColorId, accentLo); copy_(uiAnnotation_ColorId, gray50_ColorId); @@ -287,8 +288,8 @@ void setThemePalette_Color(enum iColorTheme theme) { copy_(uiIconHover_ColorId, accentLo); set_Color(uiSeparator_ColorId, mix_Color(get_Color(gray50_ColorId), get_Color(gray75_ColorId), 0.67f)); - copy_(uiMarked_ColorId, altAccentHi); - copy_(uiMatching_ColorId, accentHi); + copy_(uiMarked_ColorId, accentHi); + copy_(uiMatching_ColorId, altAccentHi); break; } set_Color(uiSubheading_ColorId, diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index d48ed9e8..30eb1d36 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c @@ -226,7 +226,7 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int } } if (isFocus) { - *frame1 = *frame2 = uiInputFrameFocused_ColorId; + *frame1 = *frame2 = (isSel ? uiText_ColorId : uiInputFrameFocused_ColorId); } int colorEscape = none_ColorId; if (startsWith_String(&d->label, "\v")) { -- cgit v1.2.3