Canvas

Canvas Tutorials

Canvas Methods and Properties

HTML canvas createLinearGradient() Method

HTML canvas createLinearGradient() Method

 

 

The createLinearGradient() method creates a linear gradient object. It is used to fill rectangles, circles, lines, etc.

 

Syntax:-

 

Its syntax is:- context.createLinearGradient(x0,y0,x1,y1)

 

Further Explanation:-

 

Parameter Description
x0 The x-coordinate of the start point of the gradient
y0 The y-coordinate of the start point of the gradient
x1 The x-coordinate of the end point of the gradient
y1 The y-coordinate of the end point of the gradient

Code Explanation

All Tutorials related to Canvas Methods and Properties

All Sections related to Canvas