sclass CheckerBoard implements MakesBufferedImage { int w = 256, h = 256; double cols = 8, rows = 8; RGB color1 = RGB(Color.black), color2 = RGB(Color.white); public int getWidth() { ret w; } public int getHeight() { ret h; } public BufferedImage getBufferedImage() { ret toBufferedImage(rgbImageFromFunction(w, h, (x, y) -> { double col = doubleRatio(x, w)*cols/2; double row = doubleRatio(y, h)*rows/2; double xlow = frac(col), ylow = frac(row); ret xlow < .5 == ylow < .5 ? color1 : color2; })); } }