Index: ui/gfx/color_utils.h |
diff --git a/ui/gfx/color_utils.h b/ui/gfx/color_utils.h |
index 6dd6300aa3bab7abdaaab1cbab3e15a3f1fbae22..18bb2c218f287ae8f956b6b4d8942791ab4e19e5 100644 |
--- a/ui/gfx/color_utils.h |
+++ b/ui/gfx/color_utils.h |
@@ -29,6 +29,20 @@ GFX_EXPORT double RelativeLuminance(SkColor color); |
GFX_EXPORT void SkColorToHSL(SkColor c, HSL* hsl); |
GFX_EXPORT SkColor HSLToSkColor(const HSL& hsl, SkAlpha alpha); |
+// Determines whether the given |hsl| falls within the given range for each |
+// component. |
+// |
+// Any components of |lower_bound| or |upper_bound| that are -1 will be |
+// ignored. |
Matt Giuca
2014/05/22 05:03:52
This could be construed as "the component will be
calamity
2014/05/22 07:36:36
Done.
|
+// |
+// For hue, the lower bound should be in the range [0, 1] and the upper bound |
+// should be in the range [(lower bound), (lower bound + 1)]. |
+// For saturation and value, bounds should be specified in the range [0, 1], |
+// with the lower bound less than the upper bound. |
+GFX_EXPORT bool IsWithinHSLRange(const HSL& hsl, |
+ const HSL& lower_bound, |
+ const HSL& upper_bound); |
+ |
// HSL-Shift an SkColor. The shift values are in the range of 0-1, with the |
// option to specify -1 for 'no change'. The shift values are defined as: |
// hsl_shift[0] (hue): The absolute hue value - 0 and 1 map |