Layer Rectangle attribute¶
- class Rectangle¶
This layer attribute provides a way of drawing rectangles with rounded corners.
- radius : int | float | None¶
The radius of the rounded corner in pixels. Defaults to 0 (no rounding).
Tip
If the
radius
is smaller than the half theborder.width
, then the border’s innercorners
will not be rounded.
- corners : List[Literal['top left', 'top right', 'bottom right', 'bottom left']]¶
This YAML list of strings specifies which corners are rounded. By default all corners are rounded. The supported values are:
'top left'
'top right'
'bottom left'
'bottom right'
layers: - background: { color: '#4051B2' } - size: { width: 100, height: 400 } offset: { x: 225, y: 115 } rectangle: radius: 50 corners: ['top left', 'bottom left'] color: red - size: { width: 600, height: 400 } offset: { x: 375, y: 115 } rectangle: radius: 200 corners: ['top right', 'bottom right'] color: green
- color : Color | Linear_Gradient | Radial_Gradient | Conical_Gradient | None¶
The shape’s fill color.
Seealso
Please review Choosing a color section for more detail.