for (int x = 0; x < getWidth(); x++) { for (int y = 0; y < getHeight(); y++) { GreenfootImage bg = getBackground(); Color beep = bg.getColorAt(x,y); Color gray = new Color(beep.getRed(),beep.getGreen(),beep.getBlue()); } }


for (int x = 0; x < getWidth(); x++) { for (int y = 0; y < getHeight(); y++) { GreenfootImage bg = getBackground(); Color beep = bg.getColorAt(x,y); Color gray = new Color(beep.getRed(),beep.getGreen(),beep.getBlue()); } }
for (int x = 0; x < getWidth(); x++) { for (int y = 0; y < getHeight(); y++) { GreenfootImage bg = getBackground(); Color beep = bg.getColorAt(x,y); int red = beep.getRed()/2; int green = beep.getGreen()/2; int blue = beep.getBlue()/2; int grey = Color gray = new Color(,,); } }
int grey = (beep.getRed()+beep.getGreen()+beep.getBlue())/3; Color gray = new Color(grey, grey, grey);