So I am working with a program that can change theme as per the user's requirements. Now I have got to change the icon color as per the theme. Suppose I have an icon "Cut.png" so it will have a large transparent area and some black lines So I want those lines(of any color) to change to the required color and the transparent area to be same. I am trying with a buffered image and I skipped the pixel that has 0 alpha but the output gives me a completely black icon :(
Here is some part of the code :
BufferedImage buf = ImageIO.read(Image Path);
int red = Color.RED.getRBG();
for(....)//Loop for Row
for(....)//Loop for column
{
Color col = new Color(buf.getRGB(x,y));
if(col.getAlpha() == 0) continue;
buf.setRGB(x,y,red);
}
My program is exactly the same and I expect that it should ignore transparent pixels and should change the colored pixels to red but the output produced is completely black :(
Thanks for your help :)