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

Unified Diff: gfx/color_utils.cc

Issue 6254004: Move more web widgets painting from webkit to chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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: gfx/color_utils.cc
diff --git a/gfx/color_utils.cc b/gfx/color_utils.cc
index 73c585baf3be58a83d578283f172bd94a7a5a941..ccddfa866e2baff7788518f3e3ba61b960d1d0f9 100644
--- a/gfx/color_utils.cc
+++ b/gfx/color_utils.cc
@@ -145,6 +145,17 @@ SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha) {
static_cast<int>(calcHue(temp1, temp2, hue - 1.0 / 3.0) * 255));
}
+SkColor BrightenColor(const HSL& hsl, SkAlpha alpha, double lightness_amount) {
tony 2011/01/14 22:06:04 Can we just use HSLShift for this? It's a little
xiyuan 2011/01/18 21:30:49 Done. Moved it into native_theme_linux.
+ HSL adjusted = hsl;
+ adjusted.l += lightness_amount;
+ if (adjusted.l > 1.0)
+ adjusted.l = 1.0;
+ if (adjusted.l < 0.0)
+ adjusted.l = 0.0;
+
+ return HSLToSkColor(adjusted, alpha);
+}
+
SkColor HSLShift(SkColor color, const HSL& shift) {
HSL hsl;
int alpha = SkColorGetA(color);

Powered by Google App Engine
This is Rietveld 408576698