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

来源:互联网 发布:淘宝店铺歌曲代码 编辑:程序博客网 时间:2024/05/24 06:09

TweenMax brightness,contrast,saturation,hue


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


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

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

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


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}});


原创粉丝点击