Mar
25
2009

Colors in Action Script. What is the alpha channel value of transparent pixels?

ActionScript uses a 32-bit hexadecimal numbers...

ARGB colors as 32 bit variables are specified by 4 groups of 8 bits each / or 2 hex each:

In binary: AAAAAAAA RRRRRRRR GGGGGGGG BBBBBBBB

In hex: AA RR GG BB

where each group defines intensity of each of the colors channels, A is alpha, R is red, G is green, B is blue.

FF is full intensity (255), 00 is no color in the channel (0).

White (full intensity on all channels) is in hex: 0xFFFFFFFF.

Black (no color in any of the Red, Green, and Blue channels) is in hex: 0xFF000000.

Full intensity on the alpha channel means no alpha (FF) and no intensity (00) means full alpha. So a transparent pixel color value is 0x00rrggbb.

Read more about operations on colors using bitwise operators here.

AS3 Tips

I'm with Adobe - Facebook group