def triangle(self, x1, y1, x2, y2, x3, y3, color):
self.context.set_source_rgb(*color)<EOL>self.context.move_to(self.tx(x1), self.ty(y1))<EOL>self.context.line_to(self.tx(x2), self.ty(y2))<EOL>self.context.line_to(self.tx(x3), self.ty(y3))<EOL>self.context.line_to(self.tx(x1), self.ty(y1))<EOL>self.context.fill()<EOL>
See the Processing function triangle():
https://processing.org/reference/triangle_.html