Represents color properties in Penpot. This interface includes properties for defining solid colors, gradients, and image fills, along with metadata.

interface Color {
    id?: string;
    name?: string;
    path?: string;
    color?: string;
    opacity?: number;
    refId?: string;
    refFile?: string;
    gradient?: Gradient;
    image?: ImageData;
}

Properties

id?: string

The optional unique identifier for the color.

name?: string

The optional name of the color.

path?: string

The optional path or category to which this color belongs.

color?: string

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

opacity?: number

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

refId?: string

The optional reference ID for an external color definition.

refFile?: string

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

gradient?: Gradient

The optional gradient fill defined by a Gradient object.

image?: ImageData

The optional image fill defined by a ImageData object.