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

Issue 2068243002: [Mac][Material Design] Adjust cutoff for detecting a "dark" theme. (Closed)

Created:
4 years, 6 months ago by shrike
Modified:
4 years, 6 months ago
Reviewers:
tapted
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Mac][Material Design] Adjust cutoff for detecting a "dark" theme. Chrome looks at the whiteComponent of a theme's custom toolbar color to decide if the theme is "dark." The line between ligth and dark is an empirical value - this cl adjusts the cutoff in hopes of getting closer to the right value. R=tapted@chromium.org BUG=614806, 617993 Committed: https://crrev.com/f4acec7a4f8fe1e3e50785a7a601499c2f7619b5 Cr-Commit-Position: refs/heads/master@{#400168}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -2 lines) Patch
M chrome/browser/ui/cocoa/chrome_browser_window.mm View 1 3 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (5 generated)
shrike
PTAL
4 years, 6 months ago (2016-06-15 17:11:28 UTC) #1
tapted
lgtm with a constant https://codereview.chromium.org/2068243002/diff/1/chrome/browser/ui/cocoa/chrome_browser_window.mm File chrome/browser/ui/cocoa/chrome_browser_window.mm (right): https://codereview.chromium.org/2068243002/diff/1/chrome/browser/ui/cocoa/chrome_browser_window.mm#newcode80 chrome/browser/ui/cocoa/chrome_browser_window.mm:80: return [theColor whiteComponent] >= 0.7; ...
4 years, 6 months ago (2016-06-16 00:45:03 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2068243002/20001
4 years, 6 months ago (2016-06-16 15:44:57 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 6 months ago (2016-06-16 16:24:58 UTC) #8
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-16 16:25:21 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/f4acec7a4f8fe1e3e50785a7a601499c2f7619b5 Cr-Commit-Position: refs/heads/master@{#400168}
4 years, 6 months ago (2016-06-16 16:26:42 UTC) #11
shrike
4 years, 6 months ago (2016-06-16 22:50:46 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/2068243002/diff/1/chrome/browser/ui/cocoa/chr...
File chrome/browser/ui/cocoa/chrome_browser_window.mm (right):

https://codereview.chromium.org/2068243002/diff/1/chrome/browser/ui/cocoa/chr...
chrome/browser/ui/cocoa/chrome_browser_window.mm:80: return [theColor
whiteComponent] >= 0.7;
On 2016/06/16 00:45:03, tapted wrote:
> does this need to be changed too?
> 
> but also these magic numbers should be at the top of the file. E.g.
> 
> // Empirically determined constants for deciding whether a theme is "dark". A
> darker background color, or a lighter foreground color than these values will
> classify a theme as dark.
> const CGFloat kDarkBackgroundUpperBound = 0.55;
> const CGFloat kDarkForegroundLowerBound = 0.7;
> 
> (or a single constant, if it makes sense to keep them the same).

Thank you. And there need to be two numbers because I believe the threshold for
labeling text as being dark is different than that of a background.

Powered by Google App Engine
This is Rietveld 408576698