Constructor
new RadialGradient(f, c, r, color_stops)
Creates a new RadialGradient with the given focal point, center point, radius, and ColorStops.
Name | Type | Description |
---|---|---|
f | Point2D | The start circle center point of the gradient. |
c | Point2D | The end circle center point of the gradient. |
r | number | The radius of the gradient. |
color_stops | Array.<ColorStop> | The color stops of the gradient. |
- Source
Classes
Members
c
The end circle center point of the gradient.
- Source
c
The end circle center point of the gradient.
- Source
color_stops
Gets the ColorStops of the gradient.
- Source
color_stops
Sets the ColorStops of the gradient.
- Source
f
The start circle center point of the gradient.
- Source
f
The start circle center point of the gradient.
- Source
r
The radius of the gradient.
- Source
r
The radius of the gradient.
- Source
Methods
color_at(p) → {Color}
Gets the Color at a given point along the gradient.
Name | Type | Description |
---|---|---|
p | Point2D | The point to get the color at. |
- Source
The color at the given point.
- Type:
- Color
color_at_offset(position) → {Color}
Gets the Color at a given offset along the gradient.
Name | Type | Description |
---|---|---|
position | number | The offset to get the color at. |
- Source
The color at the given offset.
- Type:
- Color
(static) default_radial_gradient() → {RadialGradient}
Returns the default RadialGradient, which is a gradient from the focal point to the center with the same color.
- Source
The default radial gradient.
- Type:
- RadialGradient
(static) lerp(gradient1, gradient2, t) → {RadialGradient}
Linearly interpolates between two RadialGradients given a progress value.
Name | Type | Description |
---|---|---|
gradient1 | RadialGradient | The first radial gradient. |
gradient2 | RadialGradient | The second radial gradient. |
t | number | The progress value. |
- Source
The interpolated radial gradient.
- Type:
- RadialGradient
(static) single_color_gradient(f, c, r, color, repeatsopt) → {RadialGradient}
Returns a single color radial gradient.
Name | Type | Attributes | Description |
---|---|---|---|
f | Point2D | The start circle center point of the gradient. | |
c | Point2D | The end circle center point of the gradient. | |
r | number | The radius of the gradient. | |
color | Color | The color of the gradient. | |
repeats | number | | <optional> | Number of times to repeat the color. |
- Source
A single color radial gradient.
- Type:
- RadialGradient