Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Raphael.el.lighten = function(increment) {
hsl = Raphael.rgb2hsl(this.attr('fill'));
var newLightness = (hsl.l + increment >= 1) ? 1 : (hsl.l + increment);
this.attr({fill: "hsl("+ hsl.h +","+hsl.s+","+newLightness+")"});
}
darkenState: function(state, increment) {
drawnState = this.fetchStateBy2Letter(state);
if(!drawnState) {return false}
hsl = Raphael.rgb2hsl(drawnState.attr('fill'));
var newLightness = (hsl.l - increment <= 0) ? 0 : (hsl.l - increment);
drawnState.darken(increment);
},