draw_gradient
Fills a rectangle with a linear gradient between two colors, horizontally, vertically, or diagonally. Uses ordered Bayer dithering for palette-friendly results in pixel art.
Instructions
Fill a rectangle with a linear gradient from color1 to color2.
direction is horizontal | vertical | diagonal. dither true uses an
ordered Bayer dither between the two colors instead of blending RGB — the
palette-friendly way. With dither, bands above 1 steps through that
many solid colors and dithers only the seams, which reads far cleaner than one
dither across a tall area. One undo step. Headless: pass file.
preview true also returns a before/after picture of the canvas with the changed-pixel count and bbox.
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": {
"x": "<x>",
"y": "<y>",
"width": "<width>",
"height": "<height>",
"color1": "<color1>",
"color2": "<color2>"
},
"name": "draw_gradient"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | ||
| y | Yes | ||
| file | No | ||
| bands | No | ||
| width | Yes | ||
| color1 | Yes | ||
| color2 | Yes | ||
| dither | No | ||
| height | Yes | ||
| preview | No | ||
| direction | No | vertical |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |