Two.LinearGradient

Extends: Two.Gradient

Constructor

ArgumentDescription
x1The x position of the first end point of the linear gradient.
y1The y position of the first end point of the linear gradient.
x2The x position of the second end point of the linear gradient.
y2The y position of the second end point of the linear gradient.
stopsA list of Two.Stops that contain the gradient fill pattern for the gradient.

fromObject

Returns: Two.LinearGradient

ArgumentDescription
objObject notation of a Two.LinearGradient to create a new instance

Create a new Two.LinearGradient from an object notation of a Two.LinearGradient.

nota-bene

Works in conjunction with Two.LinearGradient.toObject

left

The x and y value for where the first end point is placed on the canvas.

The x and y value for where the second end point is placed on the canvas.

copy

ArgumentDescription
gradientThe reference Two.LinearGradient

Copy the properties of one Two.LinearGradient onto another.

clone

Returns: Two.Gradient

ArgumentDescription
parentThe parent group or scene to add the clone to.

Create a new instance of Two.LinearGradient with the same properties of the current path.

toObject

Returns: Object

Return a JSON compatible plain object that represents the path.