mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Tests: add compareGradientColors helper function.
This commit is contained in:
parent
46b1311260
commit
5d48a7383a
1 changed files with 10 additions and 0 deletions
|
@ -88,6 +88,16 @@ function compareGrayColors(color1, color2, message) {
|
||||||
(message || '') + ' gray');
|
(message || '') + ' gray');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function compareGradientColors(color1, color2) {
|
||||||
|
Base.each(['origin', 'destination', 'hilite'], function(key) {
|
||||||
|
equals(color1[key].toString(), color2[key].toString(),
|
||||||
|
'color1[' + key + '].toString() == color2[' + key + '].toString()');
|
||||||
|
});
|
||||||
|
equals(function() {
|
||||||
|
return color1.gradient.equals(color2.gradient);
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
|
||||||
function cloneAndCompare(item) {
|
function cloneAndCompare(item) {
|
||||||
var copy = item.clone();
|
var copy = item.clone();
|
||||||
compareItems(item, copy);
|
compareItems(item, copy);
|
||||||
|
|
Loading…
Reference in a new issue