ShapeContainerMixin.createFill
Adds a fill paint to this container
ShapeContainerMixin.createFill() method
Adds a fill paint to this container
Signature:
createFill(opts: PaintOptions): Paint;Parameters
Parameter | Type | Description |
|---|---|---|
opts | The paint options |
Returns:
The newly created paint
Example
// Create a solid red paint
layer.createFill({
type: "SOLID",
color: { r: 255, g: 0, b: 0 },
});
// Create a gradient with default positioning (spans shape width)
layer.createFill({
type: "GRADIENT_LINEAR",
stops: [
{ color: { r: 255, g: 0, b: 0 }, offset: 0, opacity: 1 },
{ color: { r: 0, g: 0, b: 255 }, offset: 1, opacity: 1 },
],
});Last updated: August 5, 2026 at 11:47 AMEdit this page