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

Unified Diff: app/gfx/color_utils.h

Issue 190001: Add functions to alpha-blend two colors and pick the more readable of two col... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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 | « no previous file | app/gfx/color_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/gfx/color_utils.h
===================================================================
--- app/gfx/color_utils.h (revision 25041)
+++ app/gfx/color_utils.h (working copy)
@@ -52,9 +52,16 @@
// this image.
void BuildLumaHistogram(SkBitmap* bitmap, int histogram[256]);
-// Create a color from a base color and a specific alpha value.
-SkColor SetColorAlpha(SkColor c, SkAlpha alpha);
+// Returns a blend of the supplied colors, ranging from |background| (for
+// |alpha| == 0) to |foreground| (for |alpha| == 255).
+SkColor AlphaBlend(SkColor foreground, SkColor background, SkAlpha alpha);
+// Given two possible foreground colors, return the one that is more readable
+// over |background|.
+SkColor PickMoreReadableColor(SkColor foreground1,
+ SkColor foreground2,
+ SkColor background);
+
// Gets a Windows system color as a SkColor
SkColor GetSysSkColor(int which);
« no previous file with comments | « no previous file | app/gfx/color_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698