views:

877

answers:

2

is there a conversion function for color values between "#FFFFFF" <-> 0xFFFFFF

I like to read a value from String and convert it to hex number

+3  A: 

Replace # with either 0x or empty string and do a ParseInt("FFFFFF", 16)? Remember that #FFF is valid and equal to #FFFFFF.

svinto
A: 

If you are using the flex compiler you can use the mx.styles.StyleManager to convert named colours (such as the format #xxxxxx or even common names like red) to a uint.

API Reference

tylermac