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

Unified Diff: ui/gfx/color_utils.cc

Issue 2319313003: views: refactor away PlatformStyle::BackgroundColorForMdButton (Closed)
Patch Set: Created 4 years, 3 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/gfx/color_utils.cc
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index 59ecedc5dac7dcb9121c83ef1a54b98561efbe60..6c8fc5cb23402e3315b084a59fce28b4d1d2b13b 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -284,6 +284,11 @@ SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha) {
static_cast<int>(std::round(b)));
}
+SkColor ImplicitAlphaBlend(SkColor foreground, SkColor background) {
+ return AlphaBlend(SkColorSetA(foreground, 0xff), background,
Evan Stade 2016/09/08 14:50:47 nit: s/0xff/SK_AlphaOPAQUE
Elly Fong-Jones 2016/09/08 16:06:12 Done.
+ SkColorGetA(foreground));
+}
+
bool IsDark(SkColor color) {
return GetLuma(color) < 128;
}

Powered by Google App Engine
This is Rietveld 408576698