
Shreya R. answered 05/21/19
CS Major (proficient in C/Java) and versed Spanish/Math tutor
If you make a polygon from the vertices, you can use the fillPolygon() function to set the color of the triangle.
To make the triangle, make two arrays to hold the coordinates for each vertex of the triangle.
Ex:
Then make a polygon using these coordinates and use fillPolygon().