code: function (idx) {
  		var r = this.getRed(idx),
  			g = this.getGreen(idx),
  			b = this.getBlue(idx);
  
  		return Math.floor((Math.max(r, g, b) + Math.min(r, g, b)) / 2);
  	}
docs: Gets the lightness of a pixel at a specific index
  
  @method getLightnessAtIndex
  @param {int} idx Index of pixel
  @return {int} Lightness