static Rect randomRect(int w, int h, int border, int rw, int rh) { if (rw > w-border*2 || rh > h-border*2) null; ret new Rect(random(border, w-border-rw), random(border, h-border-rh), rw, rh); } ifclass RGBImage static Rect randomRect(RGBImage img, int rw, int rh) { ret randomRect(img.w(), img.h(), 0, rw, rh); } endif