1
0
mirror of https://github.com/thangisme/notes.git synced 2024-06-25 07:25:33 +00:00
notes/node_modules/onecolor/lib/plugins/grayscale.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

12 lines
342 B
JavaScript

module.exports = function grayscale(color) {
function gs () {
/*jslint strict:false*/
var rgb = this.rgb(),
val = rgb._red * 0.3 + rgb._green * 0.59 + rgb._blue * 0.11;
return new color.RGB(val, val, val, rgb._alpha);
}
color.installMethod('greyscale', gs).installMethod('grayscale', gs);
};