Add failing test for Raster#getAverageColor(path).

This commit is contained in:
Jonathan Puckey 2013-03-17 19:24:08 +01:00
parent 58247ea232
commit d7546c0c8d

View file

@ -115,4 +115,20 @@ asyncTest('Raster#getSubImage', function(callback) {
}, true);
callback();
};
});
test('Raster#getAverageColor(path)', function() {
new Path.Rectangle({
point: [0, 0],
size: [100, 100],
fillColor: new RgbColor(0, 1, 0)
});
var path = new Path.Circle({
center: [50, 50],
radius: 25,
fillColor: new RgbColor(1, 0, 0)
});
var raster = paper.project.activeLayer.rasterize();
path.scale(0.9);
compareRgbColors(raster.getAverageColor(path), new RgbColor(1, 0, 0));
});