From e7c6bf3d9b03c17d04fe68ab1d912750a5304158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 8 Apr 2013 07:27:30 -0700 Subject: [PATCH] Fix more Color tests. --- test/tests/Raster.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/tests/Raster.js b/test/tests/Raster.js index 772e42a4..696dec99 100644 --- a/test/tests/Raster.js +++ b/test/tests/Raster.js @@ -83,9 +83,10 @@ asyncTest('Raster#getPixel / setPixel', function(callback) { compareColors(raster.getPixel(0, 1), new Color(0, 0, 1, 1)); compareColors(raster.getPixel(1, 1), new Color(1, 1, 1, 1)); - var color = new Color(1, 1, 0, 0.5, 1); + // Alpha + var color = new Color(1, 1, 0, 0.50196); raster.setPixel([0, 0], color); - compareColors(raster.getPixel([0, 0]), color); + compareColors(raster.getPixel([0, 0]), color, 'alpha'); callback(); }; }); @@ -130,7 +131,7 @@ test('Raster#getAverageColor(path)', function() { }); var raster = paper.project.activeLayer.rasterize(); path.scale(0.9); - compareColors(raster.getAverageColor(path), new Color(1, 0, 0, 1)); + compareColors(raster.getAverageColor(path), new Color(1, 0, 0)); }); test('Raster#getAverageColor(path) with compound path', function() { @@ -146,11 +147,11 @@ test('Raster#getAverageColor(path) with compound path', function() { var path2 = new Path.Circle({ center: [50, 50], radius: 10 - }) + }); var compoundPath = new CompoundPath(path, path2); compoundPath.fillColor = new Color(1, 0, 0); var raster = paper.project.activeLayer.rasterize(); path.scale(0.9); path2.scale(1.1); - compareColors(raster.getAverageColor(compoundPath), new Color(1, 0, 0, 1)); + compareColors(raster.getAverageColor(compoundPath), new Color(1, 0, 0)); });