Paint: Rectangle
paint_rectDraw filled or outlined rectangles on a canvas. Supports rounded corners, solid fills, gradients, and layer targeting.
Instructions
Filled and/or outlined rectangle. radius rounds the corners (number, or [top-left, top-right, bottom-right, bottom-left]). fill/stroke take a colour or a gradient object.
Target the canvas by name (created with paint_canvas) and optionally a layer index. Layers, filters and undo work the same for every drawing tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| fill | No | A colour, or a gradient object {type, from, to, radius, colors|stops} | |
| blend | No | Blend mode for this stroke | normal |
| layer | No | Target layer index; defaults to the active layer (see paint_canvas). | |
| width | Yes | ||
| canvas | Yes | Canvas name. Letters, digits, space, dot, dash, plus; the .png/.paint suffix may be included or omitted. | |
| height | Yes | ||
| radius | No | Corner radius in pixels | |
| stroke | No | A colour, or a gradient object {type, from, to, radius, colors|stops} | |
| opacity | No | 0..1 strength of this stroke | |
| preview | No | Image reply: auto/thumb = downscaled picture back into the result, full = unpixelated, none = text only | |
| preview_size | No | Longest edge of the returned thumbnail | |
| stroke_width | No |