A, R, G, B is the general format used by video cards to provide texture blending and transparency in the texture. Most systems use only 8 bits for R, G, and B to leave another 8 bits without a 32-bit word size, which is common for a PC.
The mapping is: For Bits: 33222222 22221111 11111100 00000000 10987654 32109876 54321098 76543210 AAAAAAAA RRRRRRRR GGGGGGGG BBBBBBBB 00000000 RRRRRRRR GGGGGGGG BBBBBBBB
Something like that:
private function toARGB(rgb:uint, newAlpha:uint):uint{ var argb:uint = 0; argb = (rgb); argb += (newAlpha<<24); return argb; } private function toRGB(argb:uint):uint{ var rgb:uint = 0; argb = (argb & 0xFFFFFF); return rgb; }
NoMoreZealots
source share