Languages
[Edit]
EN

JavaScript - fill polygon on canvas element in HTML5 with certain color

8 points
Created by:
Majid-Hajibaba
972

Simple solution:

 

Using JavaScript it is possible to fill polygon with some color in following way.

1. lineTo(), closePath() and stroke() methods example

Edit

In this example it has been shown how to fill polygon with color. Read this article how to only draw polygon border.

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - HTML5 canvas tutorial

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join