Layer

class img_gen.Layer(size: Size | None = None, offset: Offset | None = None, background: Background | None = None, ellipse: Ellipse | None = None, rectangle: Rectangle | None = None, polygon: Polygon | None = None, icon: Icon | None = None, typography: Typography | None = None, mask: Mask | None = None)

A data structure to represent a single [Layer] in a [Layout].

as_json_str()

Serialize the Layer object to a JSON string.

as_yaml_str()

Serialize the Layer object to a YAML string.

background

A background attribute for the layer.

ellipse

An ellipse attribute for the layer.

static from_json_str(json_str)

Deserialize a Layer object from a JSON string.

static from_yaml_str(yaml_str)

Deserialize a Layer object from a YAML string.

icon

An icon attribute for the layer.

mask

A mask attribute for the layer.

offset

The layer’s [LayerOffset].

polygon

An polygon attribute for the layer.

rectangle

A rectangle attribute for the layer.

size

The layer’s [Size]

typography

A typography attribute for the layer.

Layer Attributes

class img_gen.Offset(x: int = 0, y: int = 0)

A layer attribute to describe the layer’s offset (from top left corner).

as_json_str()

Serialize the LayerOffset object to a JSON string.

as_yaml_str()

Serialize the LayerOffset object to a YAML string.

static from_json_str(json_str)

Deserialize a LayerOffset object from a JSON string.

static from_yaml_str(yaml_str)

Deserialize a LayerOffset object from a YAML string.

x

The offset in pixels along the x-axis.

y

The offset in pixels along the y-axis.