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

Unified Diff: ui/gfx/color_utils.cc

Issue 2319313003: views: refactor away PlatformStyle::BackgroundColorForMdButton (Closed)
Patch Set: reorder declarations 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..5fb20b15df42535c1ab50a2261fd3e3f73208249 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, SK_AlphaOPAQUE), background,
+ SkColorGetA(foreground));
+}
+
bool IsDark(SkColor color) {
return GetLuma(color) < 128;
}

Powered by Google App Engine
This is Rietveld 408576698