def rect(self, x, y, width, height, color):
self.context.set_source_rgb(*color)<EOL>self.context.rectangle(self.tx(x), self.ty(y), self.tx(width), self.ty(height))<EOL>self.context.fill()<EOL>
See the Processing function rect():
https://processing.org/reference/rect_.html