RadialGradientPaintOptions
Options for creating a radial gradient paint. If start/end are not provided, start defaults to the center of the shape bounds and end defaults to the right edge of the bounds, both vertically centered.
RadialGradientPaintOptions interface
Options for creating a radial gradient paint. If start/end are not provided, start defaults to the center of the shape bounds and end defaults to the right edge of the bounds, both vertically centered.
Signature:
interface RadialGradientPaintOptionsExample
// Create a radial gradient with defined start and end positions
group.createFill({
type: "GRADIENT_RADIAL",
start: { x: 100, y: 100 },
end: { x: 200, y: 100 },
highlightAngle: 45,
highlightLength: 50,
stops: [
{ color: { r: 255, g: 255, b: 255 }, offset: 0, opacity: 1 },
{ color: { r: 0, g: 0, b: 0 }, offset: 1, opacity: 1 },
],
});
// Create a radial gradient with defaults
group.createFill({
type: "GRADIENT_RADIAL",
stops: [
{ color: { r: 255, g: 255, b: 255 }, offset: 0, opacity: 1 },
{ color: { r: 0, g: 0, b: 0 }, offset: 1, opacity: 1 },
],
});Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
(Optional) The end point of the gradient. If not provided, defaults to the right edge of the shape bounds, vertically centered. | |||
number | (Optional) The angle of the highlight/focal point. Defaults to 0. | ||
number | (Optional) The length of the highlight/focal point from the center (-100 to 100). Defaults to 0. | ||
(Optional) The start point of the gradient. If not provided, defaults to the center of the shape bounds, vertically centered. | |||
Array of color stops defining the gradient | |||
"GRADIENT_RADIAL" |