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

Issue 2629293002: Try to improve toolbar separator coloration for themed browser windows. (Closed)

Created:
3 years, 11 months ago by Evan Stade
Modified:
3 years, 6 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Try to improve toolbar separator coloration for themed browser windows. Particularly noticeable for dark themes. There are two colors here: the separator below the toolbar/attached bookmark bar, and the separator below the detached bookmark bar. The latter is intentionally lighter than the former. There were a couple problems to fix. The luminance calculation didn't make much sense when the base color was not opaque, so that is changed to retain complete opacity. That's also changed to create a less noticeable separator, which is more in line with the value of the default theme's hardcoded colors relative to the text color. The default browser theme should be unaffected by this change. Themed windows will get slightly less noticeable separators, which addresses the symptoms shown in the linked bug. BUG=628312

Patch Set 1 #

Total comments: 2

Patch Set 2 : also change gtk a little #

Total comments: 10

Patch Set 3 : tweaks #

Patch Set 4 : revert #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -23 lines) Patch
M chrome/browser/themes/theme_properties.cc View 2 chunks +9 lines, -5 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 1 2 3 1 chunk +16 lines, -4 lines 2 comments Download
M chrome/browser/ui/libgtkui/gtk_ui.cc View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 1 chunk +3 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (4 generated)
Evan Stade
https://codereview.chromium.org/2629293002/diff/1/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2629293002/diff/1/chrome/browser/themes/theme_service.cc#newcode499 chrome/browser/themes/theme_service.cc:499: return color_utils::BlendTowardOppositeLuma( The 50% didn't match up well with ...
3 years, 11 months ago (2017-01-13 01:16:52 UTC) #2
Evan Stade
On 2017/01/13 01:16:52, Evan Stade wrote: > https://codereview.chromium.org/2629293002/diff/1/chrome/browser/themes/theme_service.cc > File chrome/browser/themes/theme_service.cc (right): > > https://codereview.chromium.org/2629293002/diff/1/chrome/browser/themes/theme_service.cc#newcode499 ...
3 years, 11 months ago (2017-01-17 19:08:28 UTC) #5
Peter Kasting
https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc#newcode481 chrome/browser/themes/theme_service.cc:481: // Same as the normal toolbar separator, but with ...
3 years, 11 months ago (2017-01-17 20:51:25 UTC) #6
Evan Stade
https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc#newcode481 chrome/browser/themes/theme_service.cc:481: // Same as the normal toolbar separator, but with ...
3 years, 11 months ago (2017-01-18 00:16:59 UTC) #7
Peter Kasting
https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc#newcode481 chrome/browser/themes/theme_service.cc:481: // Same as the normal toolbar separator, but with ...
3 years, 11 months ago (2017-01-18 00:40:16 UTC) #8
Evan Stade
https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc File chrome/browser/themes/theme_service.cc (right): https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/theme_service.cc#newcode481 chrome/browser/themes/theme_service.cc:481: // Same as the normal toolbar separator, but with ...
3 years, 11 months ago (2017-01-24 00:46:08 UTC) #10
Peter Kasting
3 years, 10 months ago (2017-01-24 21:43:33 UTC) #11
https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/t...
File chrome/browser/themes/theme_service.cc (right):

https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/t...
chrome/browser/themes/theme_service.cc:481: // Same as the normal toolbar
separator, but with increased luminance.
On 2017/01/24 00:46:08, Evan Stade wrote:
> On 2017/01/18 00:40:16, Peter Kasting wrote:
> > On 2017/01/18 00:16:59, Evan Stade wrote:
> > > On 2017/01/17 20:51:25, Peter Kasting wrote:
> > > > It seems kind of random that we increase the luminance here as a way of
> > making
> > > > this separator less noticeable.  I assume that's because the original
> author
> > > > here was thinking of a white NTP background.  Shouldn't we instead blend
> > > towards
> > > > whatever the NTP background color actually is?
> > > 
> > > In the dark case (e.g. incognito) it is actually more noticeable.
> > 
> > Which seems like a bug.  Why would we want a stronger separation between the
> > detached bar bottom and the area below it than between the toolbar and the
> > detached bar?  And why would we want it to be less noticeable in regular,
but
> > more in incognito?
> 
> In practice, it doesn't look like a bug. You can test it easily enough because
> this is what Chrome already does.
> 
> > 
> > What is the computed toolbar separator color in incognito with your changes?

> > This would help answer the question of how visible it would be if we blend
> > toward the NTP background color.
> 
> The bottom separator is essentially invisible in incognito as it is because
the
> contrast to the ntp bg is very low. This is per Sebastien's design. If we
blend
> towards the NTP bg color it is even lower in contrast and the floating
bookmark
> bar will essentially not have a separator.
> 
> If we're talking about the default theme here, this patch intentionally leaves
> the current behavior intact. I don't think there's a bug here.

Staring at the current behavior more closely, I think blending the toolbar
separator lighter happens to work for normal and incognito windows happens to
work, but only coincidentally; and my suggestion of blending towards the NTP
background color is wrong too.  The problem is that both of these start from the
toolbar separator color, but that isn't guaranteed to have any relationship to
what we want.

In the default theme, the detached bookmark bar and the NTP background are
always both the same color: white for normal windows, dark grey for incognito. 
What we want in a separator is something that will contrast with both of those.

Today, lightening the toolbar separator color produces a medium grey, which is
darker than the default window's white and lighter than the incognito window's
dark grey, and thus is visible in both cases.  But there's nothing guaranteeing
this will still be true with arbitrary theme colors.

This is basically the same problem we had to solve with
ThemeService::GetSeparatorColor(): given two arbitrary colors, find a third that
contrasts with both.  I wonder if we could just call GetSeparatorColor(), or
maybe tweak the kAlpha value it uses (i.e. pass that as a param).

https://codereview.chromium.org/2629293002/diff/20001/chrome/browser/themes/t...
chrome/browser/themes/theme_service.cc:500:
GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT, incognito), 0xBF);
On 2017/01/24 00:46:08, Evan Stade wrote:
> On 2017/01/18 00:40:16, Peter Kasting wrote:
> > On 2017/01/18 00:16:59, Evan Stade wrote:
> > > On 2017/01/17 20:51:25, Peter Kasting wrote:
> > > > Doesn't blending toward the opposite luma here assume the bookmark bar
> > > > background is (whatever the opposite luma is)?
> > > 
> > > I think it's a safe assumption that blending towards the opposite luma
will
> > make
> > > the separator a less dramatic version of the text color. This would only
not
> > be
> > > true if the bookmark text was something unreadable like black on black,
> right?
> > > Whether we want to tinge the separator color with the bookmark bar bg
color
> is
> > a
> > > matter of judgment I suppose, but the text doesn't do that so I don't know
> why
> > > the separator should.
> > 
> > The effect of the previous alpha-blend was, basically, to blend the text
color
> > toward the background color.  You said you were trying to make this fully
> > opaque; I'm looking for a way to duplicate the old effect more closely in
that
> > world.  My worry about blending toward opposite luma is that the level of
> > contrast you get is much less predictable than with "blend toward background
> > color".
> 
> I'm not sure I follow because there's no way to predict the contrast of two
> colors a theme author has chosen,

I just meant, if we're trying to guarantee the separator contrasts less than the
bookmark text, then blending toward background will achieve that, but blending
toward opposite luma could contrast more.

> but I can change this to use AlphaBlend. When
> I do that, it looks better across the handful of tested themes if I lower the
> foreground percent even further.

I wonder if this, too, should be using GetSeparatorColor() somehow.  This would
likely change the behavior for the default incognito theme (which I'd be OK with
since the black separator used there today seems invisible to me).

https://codereview.chromium.org/2629293002/diff/60001/chrome/browser/themes/t...
File chrome/browser/themes/theme_service.cc (right):

https://codereview.chromium.org/2629293002/diff/60001/chrome/browser/themes/t...
chrome/browser/themes/theme_service.cc:494: return
GetColor(ThemeProperties::COLOR_TOOLBAR, incognito);
On 2017/01/24 00:46:08, Evan Stade wrote:
> tangent: I noticed that on many themes this is better if it's
> COLOR_NTP_BACKGROUND

I agree; see https://bugs.chromium.org/p/chromium/issues/detail?id=618335 ,
especially comment 9 and comment 12.

Powered by Google App Engine
This is Rietveld 408576698