Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7849)

Unified Diff: chrome/browser/themes/theme_service.cc

Issue 2629293002: Try to improve toolbar separator coloration for themed browser windows. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/themes/theme_service.cc
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 9f5b82a5d0c094aaec0878b5f62ddfe2adbdfcb7..659adf52357a478eeb94cd1f59112e4ef2cade93 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -477,16 +477,27 @@ SkColor ThemeService::GetDefaultColor(int id, bool incognito) const {
if (UsingDefaultTheme())
break;
return GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito);
+ case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR: {
+ // Same as the normal toolbar separator, but with increased luminance.
+ // Either double it or halve the distance to 1.0, whichever is less of a
+ // difference.
+ color_utils::HSL hsl;
+ color_utils::SkColorToHSL(
+ GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR, incognito),
+ &hsl);
+ hsl.l = std::min((hsl.l + 1) / 2, hsl.l * 2);
+ return color_utils::HSLToSkColor(hsl, SK_AlphaOPAQUE);
+ }
case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_BACKGROUND:
if (UsingDefaultTheme())
break;
return GetColor(ThemeProperties::COLOR_TOOLBAR, incognito);
- case ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR:
+ case ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR:
if (UsingDefaultTheme())
break;
- // Use 50% of bookmark text color as separator color.
- return SkColorSetA(
- GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 128);
+ // Use 25% of bookmark text color as separator color.
+ return color_utils::BlendTowardOppositeLuma(
Evan Stade 2017/01/13 01:16:52 The 50% didn't match up well with what the default
+ GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 0xBF);
case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT:
return IncreaseLightness(GetColor(kNtpText, incognito), 0.30);
case ThemeProperties::COLOR_NTP_SECTION_HEADER_TEXT_HOVER:

Powered by Google App Engine
This is Rietveld 408576698