canvas
Initialize the drawing canvas with optional dimensions, background color, and center mode
canvas(
[width=640],
[height=480],
[background=#FFFFFF],
[center=false],
[ratio]
)
Initialize the drawing canvas with optional dimensions, background color, and center mode
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
width | - | 640 | Width of the canvas in pixels | |
height | - | 480 | Height of the canvas in pixels | |
background | - | #FFFFFF | Background color (hex string) | |
center | - | false | Translate coords to center | |
ratio | - | - | Aspect ratio (calculated if width or height is missing) |