function Filter(element) { Module.call(this); this.active = function(cmd) { if(cmd.content.length < 1){ return; } var p = cmd.content; var filter_name = p[0]; p.shift(); switch(filter_name) { case "saturation": this.filter_saturation(this.pixels(),p); break; } } this.passive = function(cmd) { } this.hint = function(cmd) { return "Filter: "; } // Filters this.filter_saturation = function(pixels = this.pixels(),p = null) { var d = pixels.data; for (var i=0; i