/** * Creates a tinted image from an input image with a given color. If input image is null, a blank ImageIcon will be * returned. * * @param icon image * @param color the color * @return a tinted version of the image */ public static ImageIcon createTintedImage(ImageIcon icon, Color color) { if (icon == null) return EMPTY_ICON; return new ImageIcon(TintFilter.createTintedImage(icon.getImage(), color, null)); }