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

Unified Diff: ui/app_list/views/tile_item_view.cc

Issue 289283004: Add ability to constrain dominant color selection to a HSL range. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make bounds inclusive, add saturation test Created 6 years, 7 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
Index: ui/app_list/views/tile_item_view.cc
diff --git a/ui/app_list/views/tile_item_view.cc b/ui/app_list/views/tile_item_view.cc
index 71073436b34ec2ec210d84964d0e9d77eb700688..17dcc8ce61f196ac72093f25a2b298b50e1c3730 100644
--- a/ui/app_list/views/tile_item_view.cc
+++ b/ui/app_list/views/tile_item_view.cc
@@ -105,8 +105,12 @@ void TileItemView::SetAppListItem(AppListItem* item) {
icon_->SetImage(item_->icon());
title_->SetText(base::UTF8ToUTF16(item_->name()));
- background_->set_strip_color(
- color_utils::CalculateKMeanColorOfBitmap(*item_->icon().bitmap()));
+ color_utils::GridSampler sampler;
+ background_->set_strip_color(color_utils::CalculateKMeanColorOfPNG(
Matt Giuca 2014/05/22 05:03:52 Ew, please don't convert to a PNG just to get arou
calamity 2014/05/22 07:36:36 Added overload in precursor CL.
+ gfx::Image(item_->icon()).As1xPNGBytes(),
+ color_utils::HSL{-1, 0.3, 0.2},
+ color_utils::HSL{-1, 1, 0.8},
+ &sampler));
}
gfx::Size TileItemView::GetPreferredSize() {

Powered by Google App Engine
This is Rietveld 408576698