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].- background¶
A background attribute for the layer.
- ellipse¶
An ellipse attribute for the layer.
- 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.
- 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
LayerOffsetobject to a JSON string.
- as_yaml_str()¶
Serialize the
LayerOffsetobject to a YAML string.
- x¶
The offset in pixels along the x-axis.
- y¶
The offset in pixels along the y-axis.