2 Replies Latest reply on Mar 11, 2010 4:44 PM by Daniel Pride

# Basecolor uint format

I can't tell from the documentation on basecolor uint format...

Is uint format the same as the old Hex Stuff?

0x000000 as in baseColor="#514236"

if not how do I translate real 16 bit Hex color values to whatever it is?

Thanks

Dan Pride

• ###### 1. Re: Basecolor uint format

uint = Unsigned Integer

In case of flash this means 32 Bit unsigned integer.

Numbers in general not only have a value, but various representations as well.

Example:

The Number 10 can be written as

0xA0 which is 8 bit hexadecimal representation

10 which is (assumed to be) decimal representation

012 which is assumed to be octal representation (octal = 8 based, decimal = 10 based)

16 bit hex colors would normally be

6 Bit red, 5 bit green, 5 bit blue OR

5 bit red, 6 bit green, 5 bit blue OR

5 bit red, 5 bit green, 6 bit blue

Thus I assume you mean 32 bit hex colors, as #514236 is the default CSS way of writing down 32 bit hex colors (24 bit in fact, as the other 8 bit would be alpha, but let's say you're talkin about 32 bit colors)

Thus:

"Is uint format the same as the old Hex Stuff?"

0x514236 can be said to equal #514236

Easy enough?

Conversion would be as follows to other formats:

0x514236 = 6 + 3*16 + 2 * 16^2 + 4*16^3 + 1*16 ^4 + 5*16 ^5 = your real color number as you would write it as a decimal figure

as well as

5*16 +1 = Red portion, ranging from 0-255

4*16+2 = Green portion, ranging from 0-255

3*16+6 = Blue portion, ranging from 0-255