Skip to main content

GradientRadial

Typeobject
Backlinks1

A radial gradient is a color effect that transitions radially around a point.

PropertyTypeRequired
classstringRequired
fromPointRequired
toPointRequired
stopsArray<GradientStop>Required
ellipseoneOf<numberPoint>Required

class​

Required

Type

string

Value

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

"gradientRadial"

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

ellipse​

Required

Description

When the type is set to number, the line connecting from to to is regarded as one semi-axis of the ellipse, denoted as A. The length of the other semi-axis of the ellipse is denoted as B. Then, ellipse = B / A, which is used to represent the shape of the gradient. The semi-axis B is perpendicular to A and takes the counterclockwise direction. When the type is set to point, it represents another point on the ellipse with 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

oneOf<

number

Point

>