The following snippet shows how to fill a rectangle with the gradient color pattern. In the following we are using the Linear gradient with the seven color like as rainbow.
This topic explains how to draw a shape on the canvas and how to move this shape. This topic includes the demo and the complete code with explanation.
This article demonstrate how can you draw smileys in your HTML5 document. The article also covers the how to draw an arc and fill with gradient color.
In HTML 5, we can draw the 2D shape very easily with the help of the canvas element. In the following example demonstrate how to draw a simple polygon shape.