for x in range(-5, 5): for y in range(-5,5): ctx.set_source_rgb(xx, yy, (x+y)/2) ctx.rectangle(500+100x, 500+100y, 90-x5, 90-y5) ctx.fill()