2011-07-01 06:17:45 -04:00
|
|
|
/*
|
2013-01-28 21:03:27 -05:00
|
|
|
* Paper.js - The Swiss Army Knife of Vector Graphics Scripting.
|
2011-07-01 06:17:45 -04:00
|
|
|
* http://paperjs.org/
|
|
|
|
*
|
2020-05-23 16:24:42 -04:00
|
|
|
* Copyright (c) 2011 - 2020, Jürg Lehni & Jonathan Puckey
|
|
|
|
* http://juerglehni.com/ & https://puckey.studio/
|
2011-07-01 06:17:45 -04:00
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2016-01-27 13:57:07 -05:00
|
|
|
QUnit.module('Color');
|
2011-02-19 10:48:59 -05:00
|
|
|
|
|
|
|
test('Set named color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = 'red';
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(1, 0, 0));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(255,0,0)');
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Set color to hex', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = '#ff0000';
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(1, 0, 0));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(255,0,0)');
|
2011-02-19 10:48:59 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = '#f00';
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(1, 0, 0));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(255,0,0)');
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Set color to object', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = { red: 1, green: 0, blue: 1};
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(1, 0, 1));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(255,0,255)');
|
2011-02-19 10:48:59 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = { gray: 0.2 };
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(0.2));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(51,51,51)');
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Set color to array', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var path = new Path();
|
|
|
|
path.fillColor = [1, 0, 0];
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(path.fillColor, new Color(1, 0, 0));
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(path.fillColor.toCSS(), 'rgb(255,0,0)');
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 23:57:17 -04:00
|
|
|
test('Creating Colors', function() {
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color(), new Color(0, 0, 0),
|
2014-08-16 13:24:54 -04:00
|
|
|
'Color with no arguments should be black');
|
2014-01-04 12:16:52 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color('black'), new Color(0, 0, 0),
|
2014-08-16 13:24:54 -04:00
|
|
|
'Color from name (black)');
|
2014-01-04 12:16:52 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color('red'), new Color(1, 0, 0),
|
2014-08-16 13:24:54 -04:00
|
|
|
'Color from name (red)');
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2018-10-04 11:26:48 -04:00
|
|
|
equals(new Color('transparent'), new Color(0, 0, 0, 0),
|
|
|
|
'Color from name (transparent)');
|
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color('#ff0000'), new Color(1, 0, 0),
|
2018-10-03 09:56:15 -04:00
|
|
|
'Color from hex string');
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2018-10-06 15:57:30 -04:00
|
|
|
equals(new Color('#FF3300'), new Color(1, 0.2, 0),
|
2018-10-10 17:03:38 -04:00
|
|
|
'Color from uppercase hex string');
|
2018-10-06 15:57:30 -04:00
|
|
|
|
2018-10-14 15:44:22 -04:00
|
|
|
equals(new Color('#f009'), new Color(1, 0, 0, .6),
|
|
|
|
'Color from 4 characters hex code with alpha');
|
|
|
|
|
2018-10-05 14:14:20 -04:00
|
|
|
equals(new Color('#ff000099'), new Color(1, 0, 0, .6),
|
2018-10-14 15:44:22 -04:00
|
|
|
'Color from 8 characters hex code with alpha');
|
2018-10-05 14:14:20 -04:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color('rgb(255, 0, 0)'), new Color(1, 0, 0),
|
2018-10-03 09:56:15 -04:00
|
|
|
'Color from rgb() string');
|
2013-11-23 18:02:13 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color('rgba(255, 0, 0, 0.5)'), new Color(1, 0, 0, 0.5),
|
2018-10-03 09:56:15 -04:00
|
|
|
'Color from rgba() string');
|
|
|
|
|
2018-12-13 02:48:35 -05:00
|
|
|
equals(new Color('rgba( 255, 0, 0, 0.5 )'), new Color(1, 0, 0, 0.5),
|
|
|
|
'Color from rgba() string 2nd test');
|
|
|
|
|
2019-12-05 03:04:03 -05:00
|
|
|
equals(new Color('rgb(100%, 50%, 0%)'), new Color(1, 0.5, 0),
|
|
|
|
'Color from rgb() percenst string');
|
|
|
|
|
2018-10-03 09:56:15 -04:00
|
|
|
equals(new Color('hsl(180deg, 20%, 40%)'),
|
|
|
|
new Color({ hue: 180, saturation: 0.2, lightness: 0.4 }),
|
|
|
|
'Color from hsl() string');
|
2013-11-23 18:02:13 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color({ red: 1, green: 0, blue: 1}),
|
2018-10-03 09:56:15 -04:00
|
|
|
new Color(1, 0, 1), 'Color from RGB object literal');
|
2011-03-08 20:25:50 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color({ gray: 0.2 }),
|
2014-08-16 13:24:54 -04:00
|
|
|
new Color(0.2), 'Color from gray object literal');
|
2011-03-08 20:25:50 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color({ hue: 0, saturation: 1, brightness: 1}),
|
2018-10-03 09:56:15 -04:00
|
|
|
new Color(1, 0, 0).convert('hsb'), 'Color from HSB object literal');
|
2011-03-08 20:25:50 -05:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color([1, 0, 0]), new Color(1, 0, 0),
|
2014-08-16 13:24:54 -04:00
|
|
|
'RGB Color from array');
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(new Color([1]), new Color(1),
|
2014-08-16 13:24:54 -04:00
|
|
|
'Gray Color from array');
|
2013-04-08 23:57:17 -04:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Get gray from RGB Color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 0.5, 0.2);
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 0.6152);
|
2011-02-19 10:48:59 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0.5, 0.2, 0.1);
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 0.27825);
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Get gray from HSB Color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color({hue: 0, saturation: 0, brightness: 0.2 });
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 0.19998);
|
2011-03-08 20:25:50 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Get red from HSB Color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color({hue: 0, saturation: 1, brightness: 1 });
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.red, 1);
|
2011-03-08 20:25:50 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Get hue from RGB Color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 0, 0);
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.hue, 0);
|
|
|
|
equals(color.saturation, 1);
|
2011-03-08 20:25:50 -05:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Get gray after conversion', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1);
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 1, 'color.gray');
|
|
|
|
equals(color.red, 1, 'color.red');
|
|
|
|
equals(color.blue, 1, 'color.blue');
|
2011-07-07 10:09:02 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
color.red = 0.5;
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 0.85045, 'color.gray');
|
2011-02-19 10:48:59 -05:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
color.green = 0.2;
|
2013-04-08 03:19:47 -04:00
|
|
|
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.red, 0.5, 'color.red');
|
|
|
|
equals(color.green, 0.2, 'color.green');
|
|
|
|
equals(color.blue, 1, 'color.blue');
|
2013-04-08 03:19:47 -04:00
|
|
|
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(color.gray, 0.38085, 'color.gray');
|
2011-02-19 10:48:59 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
test('Converting Colors', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var rgbColor = new Color(1, 0.5, 0.2);
|
2014-11-30 14:27:14 -05:00
|
|
|
equals(rgbColor.gray, 0.6152);
|
2014-08-16 13:24:54 -04:00
|
|
|
var grayColor = new Color(0.2);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(grayColor.convert('rgb'), new Color(0.2, 0.2, 0.2));
|
|
|
|
equals(grayColor.convert('hsb'),
|
|
|
|
new Color({ hue: 0, saturation: 0, brightness: 0.2 }));
|
|
|
|
equals(new Color(1, 0, 0).convert('hsb'),
|
|
|
|
new Color({ hue: 0, saturation: 1, brightness: 1 }));
|
2011-02-24 07:00:46 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Setting Color#gray', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 0.5, 0.2);
|
|
|
|
color.gray = 0.1;
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color, new Color(0.1));
|
2011-03-08 20:25:50 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Setting Color#red', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color({ hue: 180, saturation: 0, brightness: 0 });
|
|
|
|
color.red = 1;
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color, new Color(1, 0, 0));
|
2011-03-08 20:25:50 -05:00
|
|
|
});
|
|
|
|
|
2013-04-08 03:19:47 -04:00
|
|
|
test('Setting Color#gray', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color({ hue: 180, saturation: 0, brightness: 0 });
|
|
|
|
color.gray = 0.5;
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color, new Color(0.5));
|
2011-05-15 08:11:35 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color.read()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = Color.read([0, 0, 1]);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color, new Color(0, 0, 1));
|
2011-05-21 07:34:27 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#clone()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0, 0, 0);
|
|
|
|
equals(function() {
|
|
|
|
return color.clone() != color;
|
|
|
|
}, true);
|
2011-05-21 07:34:27 -04:00
|
|
|
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(function() {
|
|
|
|
return new Color(color) != color;
|
|
|
|
}, true);
|
2011-05-21 11:25:05 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#convert()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0, 0, 0);
|
|
|
|
var converted = color.convert('rgb');
|
|
|
|
equals(function() {
|
|
|
|
return converted !== color;
|
|
|
|
}, true);
|
|
|
|
equals(function() {
|
|
|
|
return converted.equals(color);
|
|
|
|
}, true);
|
2011-08-13 09:25:29 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Getting saturation from black RGB Color', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
equals(function() {
|
|
|
|
return new Color(0, 0, 0).saturation === 0;
|
|
|
|
}, true);
|
2013-06-28 10:19:53 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#add()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.add([1, 0, 0]), new Color([1, 1, 1]));
|
|
|
|
equals(color.add([1, 0.5, 0]), new Color([1, 1.5, 1]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0, 0.5, 0);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.add(0.5), new Color([0.5, 1, 0.5]));
|
2013-06-28 10:19:53 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#subtract()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.subtract([0, 1, 1]), new Color([0, 0, 0]));
|
|
|
|
equals(color.subtract([0, 0.5, 1]), new Color([0, 0.5, 0]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.subtract(0.5), new Color([0.5, 0.5, 0.5]));
|
2013-06-28 10:19:53 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#multiply()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 0.5, 0.25);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.multiply([0.25, 0.5, 1]), new Color([0.25, 0.25, 0.25]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.multiply(0.5), new Color([0.5, 0.5, 0.5]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(0.5, 0.5, 0.5);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.multiply(2), new Color([1, 1, 1]));
|
2013-06-28 10:19:53 -04:00
|
|
|
});
|
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#divide()', function() {
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.divide([1, 2, 4]), new Color([1, 0.5, 0.25]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 0.5, 0.25);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.divide(0.25), new Color([4, 2, 1]));
|
2014-08-16 13:24:54 -04:00
|
|
|
var color = new Color(1, 1, 1);
|
2014-12-28 09:21:38 -05:00
|
|
|
equals(color.divide(4), new Color([0.25, 0.25, 0.25]));
|
2013-06-28 10:59:33 -04:00
|
|
|
});
|
2016-03-17 04:38:42 -04:00
|
|
|
|
2016-07-25 15:09:53 -04:00
|
|
|
test('Color#equals()', function() {
|
|
|
|
var red = new Color('red');
|
|
|
|
equals(function() {
|
|
|
|
return new Color(1, 0, 0).equals(red);
|
|
|
|
}, true);
|
|
|
|
equals(function() {
|
|
|
|
return new Color(1, 0, 0, 1).equals(red);
|
|
|
|
}, true);
|
|
|
|
});
|
|
|
|
|
2016-03-17 04:38:42 -04:00
|
|
|
test('Gradient', function() {
|
2016-05-31 06:35:44 -04:00
|
|
|
var stop1 = new GradientStop({ offset: 0.5 });
|
2016-03-17 04:38:42 -04:00
|
|
|
var stop2 = new GradientStop('red', 0.75);
|
|
|
|
var stop3 = new GradientStop(['white', 1]);
|
2016-05-31 06:35:44 -04:00
|
|
|
var stop4 = new GradientStop({ rampPoint: 0.5 }); // deprecated
|
2016-03-17 04:38:42 -04:00
|
|
|
var gradient = new Gradient([stop1, stop2, stop3], true);
|
|
|
|
equals(function() { return stop1.color; }, new Color(0, 0, 0));
|
|
|
|
equals(function() { return stop2.color; }, new Color(1, 0, 0));
|
|
|
|
equals(function() { return stop3.color; }, new Color(1, 1, 1));
|
2016-05-31 06:35:44 -04:00
|
|
|
equals(function() { return stop4.color; }, new Color(0, 0, 0));
|
|
|
|
equals(function() { return stop1.offset; }, 0.5);
|
|
|
|
equals(function() { return stop2.offset; }, 0.75);
|
|
|
|
equals(function() { return stop3.offset; }, 1);
|
|
|
|
equals(function() { return stop4.offset; }, 0.5);
|
2016-03-17 04:38:42 -04:00
|
|
|
});
|
2017-03-09 08:31:41 -05:00
|
|
|
|
|
|
|
test('Gradients with applyMatrix', function() {
|
|
|
|
var topLeft = [100, 100];
|
|
|
|
var bottomRight = [400, 400];
|
|
|
|
var gradientColor = {
|
|
|
|
gradient: {
|
|
|
|
stops: ['yellow', 'red', 'blue']
|
|
|
|
},
|
|
|
|
origin: topLeft,
|
|
|
|
destination: bottomRight
|
|
|
|
}
|
|
|
|
|
|
|
|
var path = new Path.Rectangle({
|
|
|
|
topLeft: topLeft,
|
|
|
|
bottomRight: bottomRight,
|
|
|
|
fillColor: gradientColor,
|
|
|
|
applyMatrix: true
|
|
|
|
});
|
|
|
|
|
|
|
|
var shape = new Shape.Rectangle({
|
|
|
|
topLeft: topLeft,
|
|
|
|
bottomRight: bottomRight,
|
|
|
|
fillColor: gradientColor,
|
|
|
|
applyMatrix: false
|
|
|
|
});
|
|
|
|
|
|
|
|
comparePixels(path, shape);
|
|
|
|
|
|
|
|
path.scale(2);
|
|
|
|
path.rotate(45);
|
|
|
|
shape.scale(2);
|
|
|
|
shape.rotate(45);
|
|
|
|
|
|
|
|
comparePixels(path, shape);
|
|
|
|
});
|
2018-11-23 09:22:47 -05:00
|
|
|
|
2020-06-08 20:56:43 -04:00
|
|
|
test('Gradients with strokeScaling: false', function() {
|
|
|
|
var topLeft = [100, 100];
|
|
|
|
var bottomRight = [400, 400];
|
|
|
|
var gradientColor = {
|
|
|
|
gradient: {
|
|
|
|
stops: ['yellow', 'red', 'blue']
|
|
|
|
},
|
|
|
|
origin: topLeft,
|
|
|
|
destination: bottomRight
|
|
|
|
}
|
|
|
|
|
|
|
|
var path = new Shape.Rectangle({
|
|
|
|
topLeft: topLeft,
|
|
|
|
bottomRight: bottomRight,
|
|
|
|
fillColor: gradientColor,
|
|
|
|
strokeScaling: true
|
|
|
|
});
|
|
|
|
|
|
|
|
var shape = new Shape.Rectangle({
|
|
|
|
topLeft: topLeft,
|
|
|
|
bottomRight: bottomRight,
|
|
|
|
fillColor: gradientColor,
|
|
|
|
strokeScaling: false
|
|
|
|
});
|
|
|
|
|
|
|
|
comparePixels(path, shape);
|
|
|
|
|
|
|
|
path.scale(2);
|
|
|
|
path.rotate(45);
|
|
|
|
shape.scale(2);
|
|
|
|
shape.rotate(45);
|
|
|
|
|
|
|
|
comparePixels(path, shape);
|
|
|
|
})
|
|
|
|
|
2019-06-09 12:01:42 -04:00
|
|
|
test('Modifying group.strokeColor for multiple children', function() {
|
2018-11-23 09:22:47 -05:00
|
|
|
var item = new Group(new Path(), new Path());
|
|
|
|
item.strokeColor = 'red';
|
2019-06-09 12:01:42 -04:00
|
|
|
var strokeColor = item.strokeColor;
|
2018-11-23 09:22:47 -05:00
|
|
|
item.strokeColor.hue = 50;
|
2019-06-09 12:01:42 -04:00
|
|
|
equals(function() { return item.strokeColor !== undefined; }, true);
|
2018-11-23 09:22:47 -05:00
|
|
|
});
|