How to create a canvas polygon using Fabric.js ?
In this article, we are going to see how to create a canvas polygon using FabricJS. The canvas means polygon is movable and can be stretched according to requirement. Further, the polygon can be customized when it comes to the initial fill color and its coordinates.
Parameters: This function accepts two parameters as mentioned above and described below:
- points: It specifies the starting and ending coordinates for all the points of the polygon.
- options: It specifies the additional options to be applied.
Program: This example uses FabricJS to create simple editable canvas polygon.