blob: d0480cc1f07108e944737df8fa40c2f06278d214 [file] [log] [blame]
import '../image.dart';
/// Invert the colors of the [src] image.
Image invert(Image src) {
var p = src.getBytes();
for (int i = 0, len = p.length; i < len; i += 4) {
p[i] = 255 - p[i];
p[i + 1] = 255 - p[i + 1];
p[i + 2] = 255 - p[i + 2];
}
return src;
}