Fix an RGB-to-HSL bug.

This commit is contained in:
Natalie Weizenbaum 2016-11-05 23:42:07 -07:00
parent ce8e223d88
commit a15bc625bf

View File

@ -179,10 +179,10 @@ class SassColor extends Value {
if (max == min) { if (max == min) {
_saturation = 0; _saturation = 0;
} else if (_lightness < 0.5) { } else if (_lightness < 50) {
_saturation = 5000 * delta / _lightness; _saturation = 100 * delta / (max + min);
} else { } else {
_saturation = 5000 * delta / (100 - _lightness); _saturation = 100 * delta / (2 - max - min);
} }
} }