您的位置:首页 > 其它

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

2012-02-20 17:11 459 查看
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}});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐