// Get the colorizing filter
int[] targetColors = _getTargetColors(requestedProperties);
ImageFilter filter = new ColorizingFilter(_SOURCE_COLORS, targetColors);
Toolkit toolkit = Toolkit.getDefaultToolkit();
ImageProducer producer = icon.getSource();
// If direction is RTL, flip the source image
if (_isRightToLeft(context))
producer = new FilteredImageSource(producer, new MirrorImageFilter());
Image colorizedIcon =
toolkit.createImage(new FilteredImageSource(producer, filter));
// Be sure that the image is fully loaded
ImageUtils.loadImage(colorizedIcon);
// Get the width/height. We use an ImageLoader object the ImageObserver