This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

setHsl

sets hue, saturation and lighting for a layer

.setHsl (h, s, l);

h, s, l are in range of [0.0 - 1.0] or false if you don't want to change some

Example

playground({

  container: exampleContainer,

  create: function() {
    this.loadImages("ship");
  },

  render: function() {

    this.layer.clear("#224");

    this.layer.drawImage(this.images.ship, 0, 0);

    var red = cq(this.images.ship).setHsl(0, false, false);
    var desaturated = cq(this.images.ship).setHsl(false, 0, false);
    var light = cq(this.images.ship).setHsl(false, false, 1.0);

    this.layer.drawImage(red.canvas, 200, 0);
    this.layer.drawImage(desaturated.canvas, 400, 0);
    this.layer.drawImage(light.canvas, 600, 0);

  }

});


Have any questions? Don't hesitate to ask:

Post issues on github, support my work on gratipay author rezoner