Hi,

> Please revert CSSUtils and investigate why parseInt is requiring the second 
> argument.

Even if it is a typedef bug IMO passing the base there makes the code intent 
clearer as the code is dealing with both base 16 and base 10 numbers.

This is the code in question:
        public static function attributeFromColor(value:uint):String
        {   
            var hexVal:String = value.toString(16);
                        if(value > 16777215)
                        { 
                //rgba -- return rgba notation
                var rgba:Array = hexVal.match(/.{2}/g);
                for(var i:int = 0; i < 4; i++)
                {   
                    rgba[i] = parseInt(rgba[i], 16);
                }
                rgba[3] = parseInt(""+(rgba[3]/255)*1000, 10) / 1000;
                                return "rgba(" + rgba.join(",") + ")";
                        }
            return "#" + StringPadder.pad(hexVal,"0",6);
        }

I added the “,10” to the second parseInt.

What do others think? Should it stay or should it go?

Thanks,
Justin

Reply via email to