На него накладывается цвет, к примеру: "0xCC9933FF".
package {
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.filters.ColorMatrixFilter;
public class ColorMatrixFilterExample extends MovieClip {
public function ColorMatrixFilterExample() {
this.applyColor(0xCC9933FF, this.getChildByName("item"));
}
private function applyFilter(child:DisplayObject, matrix:Array):void {
var filter:ColorMatrixFilter = new ColorMatrixFilter(matrix);
var filters:Array = new Array();
filters.push(filter);
child.filters = filters;
}
private function applyColor(rgb:uint,renderer:DisplayObject):void {
var matrix:Array = new Array();
matrix = matrix.concat([((rgb>>24)&0xFF)/0xFF, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, ((rgb>>16)&0xFF)/0xFF, 0, 0, 0]); // green
matrix = matrix.concat([0, 0, ((rgb>>8)&0xFF)/0xFF, 0, 0]); // blue
matrix = matrix.concat([0, 0, 0, ((rgb)&0xFF)/0xFF, 0]); // alpha
applyFilter(renderer, matrix);
}
}
}