How to use the raphael.rgb2hsl function in raphael

To help you get started, we’ve selected a few raphael examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github harvard-lil / perma / perma_web / static / js / helpers / mapping / usmap.js View on Github external
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+")"});
}
github harvard-lil / perma / perma_web / static / js / helpers / mapping / usmap.js View on Github external
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);
    },