MCPcopy Index your code
hub / github.com/clips/pattern / invert

Function invert

pattern/canvas.js:3073–3079  ·  view source on GitHub ↗
(img)

Source from the content-addressed store, hash-verified

3071var LUMINANCE = [0.2125 / 255, 0.7154 / 255, 0.0721 / 255];
3072
3073function invert(img) {
3074 /* Returns an image with inverted colors (e.g. white becomes black).
3075 */
3076 return filter(img, function(p) {
3077 return [255-p[0], 255-p[1], 255-p[2], p[3]];
3078 });
3079}
3080
3081function colorize(img, color, bias) {
3082 /* Returns a colorized image.

Callers

nothing calls this directly

Calls 1

filterFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…