Skip to main content
Version: Alpha 1

Triangle

Draws a triangle on the canvas.

Parameters

NameTypeDescription
x1NumberThe x-coordinate of the first vertex.
y1NumberThe y-coordinate of the first vertex.
x2NumberThe x-coordinate of the second vertex.
y2NumberThe y-coordinate of the second vertex.
x3NumberThe x-coordinate of the third vertex.
y3NumberThe y-coordinate of the third vertex.
coloranyThe stroke color of the triangle. To change the fill color, use the Fill modifier.

Example

Triangle(x1: 50, y1: 0, x2: 100, y2: 100, x3: 0, y3: 100, color: 'green')