The another type of the gradient is Radial gradient that is based on the circles. We create a radial gradient by using a JavaScript method createRadialGradient(). This method requires the information about the two circle as follows: Continue reading “Radial gradient in HTML5”
Tag: canvas example
Linear gradient in HTML5
A gradient effect specifies a starting color, an ending color, and an area over which color changes and when the gradient effect defined by a straight line(gradient line) then it will be Linear gradient. Continue reading “Linear gradient in HTML5”
Draw Rectangle and Circle shape in HTML5 canvas
The following code examples shows a method that creates a rectangle and circle on the canvas. We use the strokeRect and fillRect methods to draw and fill rectangle. Continue reading “Draw Rectangle and Circle shape in HTML5 canvas”
Drawing custom shapes in HTML5 canvas
You can draw any custom shape by using rectangles, adding line segments, curves, or arcs, and optionally closing the path with stroke and different fill styles. Continue reading “Drawing custom shapes in HTML5 canvas”
Draw Rainbow with Linear gradient in HTML5
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. Continue reading “Draw Rainbow with Linear gradient in HTML5”