summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorpkasting <pkasting@chromium.org>2016-03-07 13:13:24 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-07 21:14:37 +0000
commit6a3e439037809fd5dccf11c4cd0a91fb6a637702 (patch)
tree8e8add87b74c582317d10aca060826ff2376a0b2 /ash
parent8ab4acafc5a378ea754be3caec9da13473059e82 (diff)
downloadchromium_src-6a3e439037809fd5dccf11c4cd0a91fb6a637702.zip
chromium_src-6a3e439037809fd5dccf11c4cd0a91fb6a637702.tar.gz
chromium_src-6a3e439037809fd5dccf11c4cd0a91fb6a637702.tar.bz2
color_utils cleanup:
* Attempt to define and standardize usage of "luma" vs. "(relative) luminance" vs. "lightness", at least as far as color_utils functions, comments, and direct callers are concerned. Especially the first two terms are often both called "luminance" (universally, not just in Chrome code), so the distinction is confusing. * Misc. cleanups to make caller code shorter or clearer. * Naming consistency: remove "Get" from function names where we're not doing some simple "getter" operation, but rather computing a value. * Modify some caller behaviors to be hopefully-more-correct * Note that GetReadableColor() can accept values with alpha, it will just ignore the alpha. * Add a PickContrastingColor() function, which is basically a subset of GetReadableColor(). This will be useful for an upcoming change where we want to choose between two fixed colors instead of luma-inverting a single input. * Use more precise multipliers in Luma(). BUG=none TEST=none Review URL: https://codereview.chromium.org/1761183002 Cr-Commit-Position: refs/heads/master@{#379643}
Diffstat (limited to 'ash')
-rw-r--r--ash/frame/default_header_painter.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 432764b..18086ac 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -42,8 +42,6 @@ const SkColor kHeaderContentSeparatorInactiveColor =
const SkColor kDefaultFrameColor = SkColorSetRGB(242, 242, 242);
// Duration of crossfade animation for activating and deactivating frame.
const int kActivationCrossfadeDurationMs = 200;
-// Luminance below which to use white caption buttons.
-const int kMaxLuminanceForLightButtons = 125;
// Tiles an image into an area, rounding the top corners.
void TileRoundRect(gfx::Canvas* canvas,
@@ -279,9 +277,8 @@ void DefaultHeaderPainter::PaintHeaderContentSeparator(gfx::Canvas* canvas) {
}
bool DefaultHeaderPainter::ShouldUseLightImages() {
- int luminance = color_utils::GetLuminanceForColor(
- mode_ == MODE_INACTIVE ? inactive_frame_color_ : active_frame_color_);
- return luminance < kMaxLuminanceForLightButtons;
+ return color_utils::IsDark(mode_ == MODE_INACTIVE ? inactive_frame_color_
+ : active_frame_color_);
}
void DefaultHeaderPainter::UpdateAllButtonImages() {