7,7 → 7,7 |
* @section Copyright & Disclaimer |
* |
* @author |
* (C) 2011-2013 Thomas Lahn <js@PointedEars.de> |
* (C) 2011-2014 Thomas Lahn <js@PointedEars.de> |
* |
* @partof PointedEars' JavaScript Extensions (JSX) |
* |
89,7 → 89,7 |
* |
* @param {jsx.dom.css.Color|String} color1 |
* @param {jsx.dom.css.Color|String} color2 |
* @returns {red, green, blue, opacity} |
* @return {Object} {red, green, blue, opacity} |
* @see jsx.dom.css.Color.prototype.diff() |
*/ |
jsx.dom.css.Color.diff = function (color1, color2) { |
558,15 → 558,10 |
} |
else |
{ |
if (lightness <= 0.5) |
{ |
saturation = (max - min) / (max + min); |
saturation = (lightness <= 0.5) |
? (max - min) / (max + min) |
: (max - min) / (2 - max - min); |
} |
else |
{ |
saturation = (max - min) / (2 - max - min); |
} |
} |
|
var delta = max - min; |
|
636,14 → 631,9 |
hue += 360; |
} |
|
if (max == 0) |
{ |
saturation = 0; |
} |
else |
{ |
saturation = 100 * (delta / max); |
} |
saturation = (max == 0) |
? 0 |
: 100 * (delta / max); |
|
value = 100 * max; |
|