mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add failing test for Raster#getAverageColor(path).
This commit is contained in:
parent
58247ea232
commit
d7546c0c8d
1 changed files with 16 additions and 0 deletions
|
@ -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));
|
||||
});
|
Loading…
Reference in a new issue