mirror of
https://github.com/konvajs/konva.git
synced 2025-12-29 18:34:36 +08:00
introduced new alpha component for colors. fixed #755. Created new validators namespace for getter setter validator functions
This commit is contained in:
@@ -42,12 +42,17 @@ suite('Shape', function() {
|
||||
// node: rect,
|
||||
// fillGreen: 0,
|
||||
// fillRed: 255,
|
||||
// duration: 2
|
||||
// duration: 2,
|
||||
// fillAlpha: 0
|
||||
// });
|
||||
|
||||
// tween.play();
|
||||
|
||||
|
||||
|
||||
layer.draw();
|
||||
|
||||
//console.log(layer.getContext().getTrace());
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
|
||||
@@ -2,10 +2,21 @@ suite('Util', function(){
|
||||
var util;
|
||||
|
||||
test('get()', function(){
|
||||
var get = Kinetic.Util.get;
|
||||
assert.equal(Kinetic.Util.get(1, 2), 1);
|
||||
assert.equal(Kinetic.Util.get(undefined, 2), 2);
|
||||
assert.equal(Kinetic.Util.get(undefined, {foo:'bar'}).foo, 'bar');
|
||||
});
|
||||
|
||||
test('test _getRGBString()', function(){
|
||||
|
||||
assert.equal(Kinetic.Util._getRGBAString({}), 'rgba(0,0,0,1)');
|
||||
|
||||
assert.equal(Kinetic.Util._getRGBAString({
|
||||
red: 100,
|
||||
green: 150,
|
||||
blue: 200,
|
||||
alpha: 0.5
|
||||
}), 'rgba(100,150,200,0.5)');
|
||||
|
||||
assert.equal(get(1, 2), 1);
|
||||
assert.equal(get(undefined, 2), 2);
|
||||
assert.equal(get(undefined, {foo:'bar'}).foo, 'bar');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user