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

Unified Diff: ui/gfx/color_utils.cc

Issue 2319313003: views: refactor away PlatformStyle::BackgroundColorForMdButton (Closed)
Patch Set: nits and rename 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
« no previous file with comments | « ui/gfx/color_utils.h ('k') | ui/native_theme/common_theme.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_utils.cc
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index 59ecedc5dac7dcb9121c83ef1a54b98561efbe60..e35d7b33fb8dc8576969c3908e2da96541060f3a 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 GetResultingPaintColor(SkColor foreground, SkColor background) {
+ return AlphaBlend(SkColorSetA(foreground, SK_AlphaOPAQUE), background,
+ SkColorGetA(foreground));
+}
+
bool IsDark(SkColor color) {
return GetLuma(color) < 128;
}
« no previous file with comments | « ui/gfx/color_utils.h ('k') | ui/native_theme/common_theme.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698