Commit 0bfc046c authored by John Smith's avatar John Smith Committed by Commit Bot

Windows Dark Mode: Update inactive tint to avoid hue shift

Bug: 1052427

This follows up http://crrev.com/c/1941064. The hue shift, with certain
accent colors could cause unexpected changes like a red accent titlebar
turning to blue when inactive. This change is to remove the hue shift
so the color overall stays in the same space but to still maintain as
close to the kGoogleGrey900 (0x20, 0x21, 0x24) ->
kGoogleGrey800 (0x3C, 0x40, 0x43) as possible.

With kGoogleGrey900 as the input, this code outputs (0x3B, 0x3E, 0x44).
I chose this one because it was very close to (0x3C, 0x40, 0x43) and kept
the overall color biased towards the green and blue channels.

Some other options considered were:
return {-1, 0.53, 0.567};  #3C3E43
return {-1, -1, 0.57};  #3F4043
return {-1, -1, 0.569};  #3F4042
return {-1, -1, 0.572};  #404144
return {-1, -1, 0.568};  #3E3F42
return {-1, 0.55, 0.567};  #3B3D44
return {-1, 0.54, 0.567};  #3B3E44
return {-1, 0.54, 0.57};  #3D3F45

Boosting the red channel and losing the green were resulting in
slightly warm and faded colors that didn't feel like they fit in the
Chromium color set.

Tested against the default Windows set of accent colors and saw
differentiation between active and inactive windows without unexpected
color shifts.

As a note on existing behavior, the colors of the new tab button and
background tab text can switch between active/inactive window states.

Change-Id: Ib67d11c720c58036cb255aee743916d6a8f2bab9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063737
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742803}
parent 84643a40
...@@ -267,11 +267,12 @@ color_utils::HSL ThemeProperties::GetDefaultTint(int id, ...@@ -267,11 +267,12 @@ color_utils::HSL ThemeProperties::GetDefaultTint(int id,
return {-1, 0.7, 0.075}; // #DEE1E6 -> kGoogleGrey900 return {-1, 0.7, 0.075}; // #DEE1E6 -> kGoogleGrey900
if (id == TINT_FRAME_INACTIVE) { if (id == TINT_FRAME_INACTIVE) {
// |dark_mode| is only true here when attempting to tint the Windows native // |dark_mode| is only true here when attempting to tint the Windows native
// frame color while in dark mode. The goal in this case is to match the // frame color while in dark mode when using OS accent titlebar colors.
// difference between Chrome default dark mode active and inactive frames, // The goal in this case is to match the difference between Chrome default
// so return a shift that matches that. // dark mode active and inactive frames as closely as possible without
// a hue change.
if (dark_mode) if (dark_mode)
return {0.59, 0.53, 0.567}; // kGoogleGrey900 -> kGoogleGrey800 return {-1, 0.54, 0.567}; // Roughly kGoogleGrey900 -> kGoogleGrey800
if (incognito) if (incognito)
return {0.57, 0.65, 0.1405}; // #DEE1E6 -> kGoogleGrey800 return {0.57, 0.65, 0.1405}; // #DEE1E6 -> kGoogleGrey800
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment