static bool rgbAllOneColor(RGBImage img, int x1, int y1, int w, int h) { if (w == 0 || h == 0) true; int color = img.getInt(x1, y1); for y to h: for x to w: if (img.getInt(x1+x, y1+y) != color) false; true; }