+ if(alphapalette && i<alphapalettelen) {
+ rgba[i].a = alphapalette[i];
+ if(alphapalette[i] == 0) {
+ /* if the color is fully transparent, it doesn't matter
+ what it's rgb values are. furthermore, all Flash
+ players up to Flash 5 can't deal with anything beyond
+ one transparent color with value (00,00,00,00). */
+ rgba[i].r = rgba[i].g = rgba[i].b = 0;
+ }
+ } else {
+ rgba[i].a = 255;
+ }