Commit 958e0144 by Aaron Leung

Enforcing upper bounds when constructing hsl values.

parent 835c9c76
......@@ -208,8 +208,14 @@ namespace Sass {
Node hsla_impl(double h, double s, double l, double a, Node_Factory& new_Node) {
h = static_cast<double>(((static_cast<int>(h) % 360) + 360) % 360) / 360.0;
s = (s < 0) ? 0 : (s / 100.0);
l = (l < 0) ? 0 : (l / 100.0);
s = (s < 0) ? 0 :
(s > 100) ? 100 :
s;
l = (l < 0) ? 0 :
(l > 100) ? 100 :
l;
s /= 100.0;
l /= 100.0;
double m2;
if (l <= 0.5) m2 = l*(s+1.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment