Hey guys!
I've got an image that has some red parts.
How can I paint all red parts blue?
The Color-code of the red part is 178,34,34
And the Color-code of the blue color is 30,144,255
Color fromColor = new Color(178, 34, 34);
Color toColor = new Color(30, 144, 255);
GreenfootImage image = new GreenfootImage("ImageFilename");
for (int i = 0; i < image.getWidth(); i++)
{
for (int j = 0; j < image.getHeight(); j++)
{
if (fromColor.equals(image.getColorAt(i, j))) image.setColorAt(i, j, toColor);
}
}