I don't really understand your question but if you're trying to get the white color to become shaded when you click it (pixel at a time) then you could use this to darken the pixel:
public BufferedImage shadePixel(BufferedImage img, int x, int y, int darkness){
//x is the mouse x position & y is the mouse y position
Color color = new Color(img.getRGB(x, y));
int imgR = color.getRed()-darkness;//if it makes it brighter try + instead of -
int imgG = color.getGreen()-darkness;
int imgB = color.getBlue()-darkness;
Color color2 = new Color(imgR, imgG, imgB);
img.setRGB(x, y, color2.getRGB());
return img;
}
Hope it helps :)
But if you meant for it to detect the different shades then you could try this:
public boolean isShadeOfWhite(BufferedImage img, int x, int y){
Color color = new Color(img.getRGB(x, y));
int imgR = color.getRed();
int imgG = color.getGreen();
int imgB = color.getBlue();
if(imgR == imgG && imgR == imgB){
return true;
}
return false;
}