Question

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

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top