Skip to main content

GradientLinear

Typeobject
Backlinks1

A linear gradient refers to the effect of transitioning between two or more different colors in a straight line.

PropertyTypeRequired
classstringRequired
fromPointRequired
toPointRequired
stopsArray<GradientStop>Required

class​

Required

Type

string

Value

constant: the value of this property must be equal to:

"gradientLinear"

from​

Required

Description

A relative coordinate according to the bounds, where (0, 0) represents the top-left corner of the bounds, and (1, -1) represents the bottom-right corner of the bounds.

Type

Point

to​

Required

Description

A relative coordinate according to the bounds, where (0, 0) represents the top-left corner of the bounds, and (1, -1) represents the bottom-right corner of the bounds.

Type

Point

stops​

Required

Description

A list of positions shows how the colors transition from one to another. If the number of items is 1, it means the color of the stop will not transition.

Type

Array<GradientStop>

Value

minimum number of items: the minimum number of items for this array is: 1