Skip to content

Commit

Permalink
[Cr96-followup] Fixes Task Manager colors.
Browse files Browse the repository at this point in the history
Fixes brave/brave-browser#19241

- Added table selection and grouping colors overrides
- Organized colors by UI elements and alphabetized within

Chromium change:

https://source.chromium.org/chromium/chromium/src/+/9ff93f5baeaa7e547bc56ca3e00c017f74aa7358

commit 9ff93f5baeaa7e547bc56ca3e00c017f74aa7358
Author: Peter Kasting <pkasting@chromium.org>
Date:   Wed Sep 15 20:32:00 2021 +0000

    Port the majority of ui/views/controls/ to color pipeline.

    Bug: 1249558
  • Loading branch information
mkarolin committed Nov 5, 2021
1 parent d195157 commit 503fff4
Showing 1 changed file with 44 additions and 10 deletions.
54 changes: 44 additions & 10 deletions chromium_src/ui/color/ui_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,63 @@ void AddBraveUiColorMixer(ColorProvider* provider,
bool high_contrast) {
ColorMixer& mixer = provider->AddMixer();

// For deprecated kColorId_ButtonEnabledColor
mixer[kColorButtonForeground] = {dark_window ? SK_ColorWHITE
: gfx::kBraveGrey800};
mixer[kColorButtonForegroundChecked] = {kColorButtonForeground};
// For deprecated kColorId_ProminentButtonFocusedColor
mixer[kColorButtonBackgroundProminentFocused] = {gfx::kBraveColorBrand};
// For deprecated kColorId_ProminentButtonColor
mixer[kColorButtonBackgroundProminent] = {gfx::kBraveColorBrand};
// --------------------------------------------------------------------------
// Border colors
// --------------------------------------------------------------------------
// For deprecated kColorId_FocusedBorderColor
mixer[kColorFocusableBorderFocused] = {gfx::kBraveColorBrand};

// --------------------------------------------------------------------------
// Button colors
// --------------------------------------------------------------------------
// For deprecated kColorId_ProminentButtonColor
mixer[kColorButtonBackgroundProminent] = {gfx::kBraveColorBrand};
// For deprecated kColorId_ProminentButtonDisabledColor
mixer[kColorButtonBackgroundProminentDisabled] = {gfx::kGoogleGrey800};
// For deprecated kColorId_TextOnProminentButtonColor
mixer[kColorButtonForegroundProminent] = {SK_ColorWHITE};
// For deprecated kColorId_ProminentButtonFocusedColor
mixer[kColorButtonBackgroundProminentFocused] = {gfx::kBraveColorBrand};
// For deprecated kColorId_ButtonBorderColor
// TODO(simonhong): Add this color to palette.
mixer[kColorButtonBorder] = {SkColorSetRGB(0xc3, 0xc4, 0xcf)};
// For deprecated kColorId_ButtonEnabledColor
mixer[kColorButtonForeground] = {dark_window ? SK_ColorWHITE
: gfx::kBraveGrey800};
mixer[kColorButtonForegroundChecked] = {kColorButtonForeground};
// For deprecated kColorId_TextOnProminentButtonColor
mixer[kColorButtonForegroundProminent] = {SK_ColorWHITE};

// --------------------------------------------------------------------------
// Label colors
// --------------------------------------------------------------------------
// For deprecated kColorId_LabelEnabledColor
mixer[kColorLabelForeground] = {kColorButtonForeground};

// --------------------------------------------------------------------------
// Link colors
// --------------------------------------------------------------------------
// For deprecated kColorId_LinkEnabled & kColorId_LinkPressed
mixer[kColorLinkForeground] = {dark_window ? gfx::kBraveColorOrange300
: gfx::kBraveColorBrand};
mixer[kColorLinkForegroundPressed] = {kColorLinkForeground};

// --------------------------------------------------------------------------
// Table colors (e.g. Task Manager)
// --------------------------------------------------------------------------
// For deprecated kColorId_TableSelectionBackgroundFocused and
// kColorId_TableSelectionBackgroundUnfocused (which were
// AlphaBlend(kColorId_ProminentButtonColor, kColorId_WindowBackground,
// SkAlpha{0x3C}))
mixer[kColorTableBackgroundSelectedFocused] =
AlphaBlend(gfx::kBraveColorBrand, kColorPrimaryBackground, 0x3C);
mixer[kColorTableBackgroundSelectedUnfocused] = {
kColorTableBackgroundSelectedFocused};
// For deprecated kColorId_TableGroupingIndicatorColor (which was the same as
// kColorId_FocusedBorderColor)
mixer[kColorTableGroupingIndicator] = {gfx::kBraveColorBrand};

// --------------------------------------------------------------------------
// Text colors
// --------------------------------------------------------------------------
// For deprecated kColorId_TextfieldSelectionBackgroundFocused
mixer[kColorTextfieldSelectionBackground] = {
dark_window ? gfx::kGoogleBlue800 : gfx::kGoogleBlue200};
Expand Down

0 comments on commit 503fff4

Please sign in to comment.