Chromium Code Reviews| 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); |