mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 09:50:05 +08:00
added another hsv test
This commit is contained in:
@@ -45,6 +45,51 @@ suite('HSV', function() {
|
||||
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('saturate image', function(done) {
|
||||
var stage = addStage();
|
||||
|
||||
var imageObj = new Image();
|
||||
imageObj.onload = function() {
|
||||
|
||||
var layer = new Kinetic.Layer();
|
||||
darth = new Kinetic.Image({
|
||||
x: 10,
|
||||
y: 10,
|
||||
image: imageObj,
|
||||
draggable: true
|
||||
});
|
||||
|
||||
layer.add(darth);
|
||||
stage.add(layer);
|
||||
|
||||
darth.cache();
|
||||
darth.filters([Kinetic.Filters.HSV]);
|
||||
|
||||
darth.saturation(2);
|
||||
layer.draw();
|
||||
|
||||
var tween = new Kinetic.Tween({
|
||||
node: darth,
|
||||
duration: 1.0,
|
||||
saturation: 0,
|
||||
easing: Kinetic.Easings.EaseInOut
|
||||
});
|
||||
|
||||
darth.on('mouseover', function() {
|
||||
tween.play();
|
||||
});
|
||||
|
||||
darth.on('mouseout', function() {
|
||||
tween.reverse();
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
imageObj.src = 'assets/bamoon.jpg';
|
||||
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
test('saturation tween transparancy', function(done) {
|
||||
var stage = addStage();
|
||||
|
Reference in New Issue
Block a user