AS3颜色转换CSS colorString 转 uint

public static function webColor2Uint(color:String):uint
{
    var uintColor:uint;
    if (color.indexOf("#") != -1)
    {
        var r:RegExp=new RegExp(/#/g);        
        uintColor = uint(String(color).replace(r, "0x"));
    }
    else if (color.indexOf("0x") != -1)
    {
        uintColor = uint(color);
    }
    return uintColor;
}
            

 

posted @ 2013-01-07 11:56  黄龙  阅读(345)  评论(0编辑  收藏  举报