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

Unified Diff: ash/frame/default_header_painter.cc

Issue 1761183002: color_utils cleanup: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename functions Created 4 years, 10 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
« no previous file with comments | « apps/ui/views/app_window_frame_view.cc ('k') | chrome/browser/extensions/bookmark_app_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/frame/default_header_painter.cc
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 432764b27f9a96290d53c7b5c784907b067787a5..18086ac62e0c8971a0d07bf6cd1e30f974299ede 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() {
« no previous file with comments | « apps/ui/views/app_window_frame_view.cc ('k') | chrome/browser/extensions/bookmark_app_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698