draw_gradient
Fills a rectangle with a linear gradient from evenly spaced color stops, supporting horizontal or vertical direction and dithering for pixel-art shading.
Instructions
Fill rect with a linear gradient through evenly spaced colour stops.
The first column (or row, for vertical) gets the first colour and the last one the last colour, measured over the whole rect even where it leaves the canvas; only the part on the canvas is painted and the rest is counted in skipped_outside. dither="none" mixes the two neighbouring stops per channel, alpha included, rounding halves up; indexed sprites then get the nearest palette entry for each mix. A bayer dither uses only the stop colours: each pixel takes the next stop when its position in the segment (0..1) is above the matrix threshold at its canvas position.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>",
"rect": "<rect>",
"colors": "<colors>"
},
"name": "draw_gradient"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Sprite file. Relative paths resolve against the server root. | |
| rect | Yes | Canvas rectangle to paint | |
| blend | No | false: pixels get exactly this colour (transparent erases, except on a background layer, which ignores alpha); true: the colour is alpha-blended over what is there | |
| frame | No | 1-based frame number | |
| layer | No | Layer name or 'group/child' path; empty = the bottom-most normal layer | |
| colors | Yes | Gradient stops, evenly spaced | |
| dither | No | Ordered dithering between stops; none gives hard bands | none |
| direction | No | horizontal runs left to right | horizontal |
| create_cel | No | Add an empty cel when the layer has none in that frame |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||