Skip to content

Commit

Permalink
Update update alert color from app menu for light theme
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhong committed Jun 11, 2024
1 parent 43529e3 commit e8ae475
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions browser/ui/color/brave_color_mixer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,28 @@ void AddBravifiedChromeThemeColorMixer(ui::ColorProvider* provider,
ui::kColorAlertLowSeverity, kColorToolbar);
mixer[kColorAppMenuHighlightSeverityHigh] = {
kColorAvatarButtonHighlightSyncError};
mixer[kColorAppMenuHighlightSeverityMedium] = AdjustHighlightColorForContrast(
ui::kColorAlertMediumSeverityIcon, kColorToolbar);

const bool is_dark = key.color_mode == ui::ColorProviderKey::ColorMode::kDark;

// For dark, AdjustHighlightColorForContrast() gives proper colors but
// not for others. Instead, pick the contrast color for them.
if (key.custom_theme || !is_dark) {
mixer[kColorAppMenuHighlightSeverityMedium] = {
PickColorContrastingToToolbar(key, mixer,
SkColorSetRGB(0xBB, 0x88, 0x00),
SkColorSetRGB(0xE2, 0xA5, 0x00))};
} else {
mixer[kColorAppMenuHighlightSeverityMedium] =
AdjustHighlightColorForContrast(ui::kColorAlertMediumSeverityIcon,
kColorToolbar);
}

if (key.custom_theme) {
return;
}

key.color_mode == ui::ColorProviderKey::ColorMode::kDark
? AddChromeDarkThemeColorMixer(provider, key)
: AddChromeLightThemeColorMixer(provider, key);
is_dark ? AddChromeDarkThemeColorMixer(provider, key)
: AddChromeLightThemeColorMixer(provider, key);
}

void AddBraveLightThemeColorMixer(ui::ColorProvider* provider,
Expand Down

0 comments on commit e8ae475

Please sign in to comment.