Skip to main content

Rect

Arbitrary size area filled with a given color.

This widget extends Canvas.


Config is a struct of the following type:

struct {
/// The color the rectangle will be filled with
color: Color = Color.black,
/// The preferred size of the rectangle, or null to
/// take the least area available.
size: ?Size = null,
};

Functions

None specific to this component.

Properties

NameTypeDescription
colorColorThe color of the rectangle
preferredSize?SizeOptional Size giving the preferred size of the rectangle

Examples

Example:

Rect(.{ .color = Color.yellow })