This page is work-in-progress. You can reach me on twitter or mail to rezoner1337@gmail.com

Polygon

Creates a polygon path and close it

cq().polygon(vertices);
cq().fillPolygon(vertices);
cq().strokePolygon(vertices);

Example

Let's draw a triangle.

  var layer = cq(300, 300).clear("#048").appendTo(document.body);

  layer
    .fillStyle("#0af")    
    .polygon([[100, 100], [150, 50], [200, 100]])
    .fill();


Have any questions? Don't hesitate to ask:

Post issues on github, support my work on gratipay author rezoner