jquery/jquery-color — pull request #47 by bseth99 (2012-10-16 20:05:37+00:00)
Title: hsla.to() produces wrong saturation for white

When a new color object is created using rgb(255,255,255), anytime its converted to the HSL space, the saturation will be 100%. This adversely affects using lightness() to reduce its value to something less than 100%, because the resulting color will be a shade of red not gray as expected:

http://jsfiddle.net/bseth99/xxuvk/

I reviewed the Wikipedia article and found that when the chroma is equal to 0, then the saturation should be 0%:

http://en.wikipedia.org/wiki/HSL_and_HSV#Saturation

The change follows the logic/calcs in the article and produces the desired results.