From 115176414e66fc107ab0112827bfcbb38cec96b2 Mon Sep 17 00:00:00 2001 From: petemill Date: Tue, 18 Sep 2018 21:11:43 -0700 Subject: [PATCH] Iterate the UI light theme Fix https://github.com/brave/brave-browser/issues/961 Hardcoded colors for now, will follow-up with variables for the palette and re-using from Omnibox to ThemeProperties when we validate these values with the designers in the build. --- browser/themes/theme_properties.cc | 34 ++++++++----------- .../browser/ui/omnibox/omnibox_theme.cc | 6 ++-- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/browser/themes/theme_properties.cc b/browser/themes/theme_properties.cc index d51f370d5aa2..e0246159581a 100644 --- a/browser/themes/theme_properties.cc +++ b/browser/themes/theme_properties.cc @@ -9,37 +9,43 @@ namespace { +const SkColor kLightToolbar = SkColorSetRGB(0xf3, 0xf3, 0xf3); +const SkColor kLightFrame = SkColorSetRGB(0xd5, 0xd9, 0xdc); +const SkColor kLightToolbarIcon = SkColorSetRGB(0x42, 0x42, 0x42); + base::Optional MaybeGetDefaultColorForBraveLightUi(int id) { switch (id) { // Applies when the window is active, tabs and also tab bar everywhere except active tab case ThemeProperties::COLOR_FRAME: case ThemeProperties::COLOR_BACKGROUND_TAB: - return SkColorSetRGB(0xD8, 0xDE, 0xE1); + case ThemeProperties::COLOR_TOOLBAR_CONTENT_AREA_SEPARATOR: + return kLightFrame; // Window when the window is innactive, tabs and also tab bar everywhere except active tab case ThemeProperties::COLOR_FRAME_INACTIVE: case ThemeProperties::COLOR_BACKGROUND_TAB_INACTIVE: - return SkColorSetRGB(0xC8, 0xCE, 0xC8); + return color_utils::HSLShift(kLightFrame, { -1, -1, 0.6 }); // Active tab and also the URL toolbar // Parts of this color show up as you hover over innactive tabs too case ThemeProperties::COLOR_TOOLBAR: + case ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR: + case ThemeProperties::COLOR_TOOLBAR_TOP_SEPARATOR_INACTIVE: case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND: case ThemeProperties::COLOR_CONTROL_BACKGROUND: - case ThemeProperties::COLOR_TOOLBAR_CONTENT_AREA_SEPARATOR: - return SkColorSetRGB(0xF6, 0xF7, 0xF9); + return kLightToolbar; case ThemeProperties::COLOR_TAB_TEXT: - return SkColorSetRGB(0x22, 0x23, 0x26); case ThemeProperties::COLOR_BOOKMARK_TEXT: case ThemeProperties::COLOR_BACKGROUND_TAB_TEXT: - return SkColorSetRGB(0x22, 0x23, 0x26); - case ThemeProperties::COLOR_LOCATION_BAR_BORDER: - return SkColorSetRGB(0xd5, 0xd9, 0xdc); + case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON: + return kLightToolbarIcon; + case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE: + return color_utils::AlphaBlend(kLightToolbarIcon, kLightToolbar, 77); default: return base::nullopt; } } -const SkColor kDarkFrame = SkColorSetRGB(0x22, 0x22, 0x22); const SkColor kDarkToolbar = SkColorSetRGB(0x39, 0x39, 0x39); +const SkColor kDarkFrame = SkColorSetRGB(0x22, 0x22, 0x22); const SkColor kDarkToolbarIcon = SkColorSetRGB(0xed, 0xed, 0xed); base::Optional MaybeGetDefaultColorForBraveDarkUi(int id) { @@ -66,11 +72,6 @@ base::Optional MaybeGetDefaultColorForBraveDarkUi(int id) { case ThemeProperties::COLOR_BOOKMARK_TEXT: case ThemeProperties::COLOR_BACKGROUND_TAB_TEXT: return SkColorSetRGB(0xFF, 0xFF, 0xFF); - case ThemeProperties::COLOR_LOCATION_BAR_BORDER: - // TODO: Should be location bar background, but location bar has hover - // color which we don't have access to here. - // Consider increasing height instead. - return kDarkToolbar; case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON: return kDarkToolbarIcon; case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE: @@ -108,11 +109,6 @@ base::Optional MaybeGetDefaultColorForPrivateUi(int id) { case ThemeProperties::COLOR_BOOKMARK_TEXT: case ThemeProperties::COLOR_BACKGROUND_TAB_TEXT: return SkColorSetRGB(0xFF, 0xFF, 0xFF); - case ThemeProperties::COLOR_LOCATION_BAR_BORDER: - // TODO: Should be location bar background, but location bar has hover - // color which we don't have access to here. - // Consider increasing height instead. - return kPrivateToolbar; case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON: return kDarkToolbarIcon; case ThemeProperties::COLOR_TOOLBAR_BUTTON_ICON_INACTIVE: diff --git a/chromium_src/chrome/browser/ui/omnibox/omnibox_theme.cc b/chromium_src/chrome/browser/ui/omnibox/omnibox_theme.cc index dca14240131f..3c4d0608ab56 100644 --- a/chromium_src/chrome/browser/ui/omnibox/omnibox_theme.cc +++ b/chromium_src/chrome/browser/ui/omnibox/omnibox_theme.cc @@ -62,8 +62,10 @@ SkColor GetOmniboxColor(OmniboxPart part, -1, -1, hovered ? 0.54 : 0.52 }) - : (hovered ? gfx::kGoogleGrey100 - : SkColorSetRGB(0xff, 0xff, 0xff))); + : (hovered ? color_utils::AlphaBlend(SK_ColorWHITE, + SkColorSetRGB(0xf3, 0xf3, 0xf3), + 178) + : SK_ColorWHITE)); } case OmniboxPart::LOCATION_BAR_TEXT_DEFAULT: case OmniboxPart::RESULTS_TEXT_DEFAULT: {