Represents fill properties in Penpot. You can add a fill to any shape except for groups. This interface includes properties for defining solid color fills, gradient fills, and image fills.

interface Fill {
    fillColor?: string;
    fillOpacity?: number;
    fillColorGradient?: Gradient;
    fillColorRefFile?: string;
    fillColorRefId?: string;
    fillImage?: ImageData;
}

Properties

fillColor?: string

The optional solid fill color, represented as a string (e.g., '#FF5733').

fillOpacity?: number

The optional opacity level of the solid fill color, ranging from 0 (fully transparent) to 1 (fully opaque). Defaults to 1 if omitted.

fillColorGradient?: Gradient

The optional gradient fill defined by a Gradient object.

fillColorRefFile?: string

The optional reference to an external file for the fill color.

fillColorRefId?: string

The optional reference ID within the external file for the fill color.

fillImage?: ImageData

The optional image fill defined by a ImageData object.