AS3 使用TweenMax来改变显示对象亮度、对比度、饱和度、色相

TweenMax brightness,contrast,saturation,hue


Baidu 版:http://hi.baidu.com/linrao/blog/item/e29c3c83cbad9cbd0cf4d287.html?timeStamp=1329729350101


刚打开开源的TweenMax.as,发现TweenMax.as很强大。

支持修改显示对象的属性值也越来越多,其实发现,有一项,自己比较经常用的:

 *  
  • colorMatrixFilter : Object - To apply a ColorMatrixFilter, pass an object with one or more of the following properties: * colorize, amount, contrast, brightness, saturation, hue, threshold, relative, matrix, remove, addFilter, index

  • colorMatrixFilter:颜色矩阵滤镜

    以下四个就是Flash(.fla编辑器)的元件属性:

     

    1、亮度 brightness

    2、对比度 contrast

    3、饱和度 saturation

    4、色相 hue

     

    如图:

     

    测试代码:

     

    private function getBall():Sprite
    {
        var ball:Sprite=new Sprite();
        ball.graphics.beginFill(0xff0000);
        ball.graphics.drawCircle(0,0,15);
        ball.graphics.endFill();
        return ball;
    }
     
    var ball:Sprite=getBall();
    TweenMax.to(ball,1,{colorMatrixFilter:{hue:100}});


    你可能感兴趣的:(AS3,properties,matrix,function,object,flash,测试)