draw_grid_ascii
Paint a complete 2D sprite or region on a live canvas by mapping ASCII character rows to hex colors, skipping unmapped dots and spaces so agents can define pixel art quickly and consistently.
Instructions
Paint an entire 2D sprite or region quickly using ASCII character rows and a char->hex color palette map. Characters "." or " " are skipped unless mapped in palette or clearBackground is true.
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": {
"rows": "<rows>",
"palette": "<palette>"
},
"name": "draw_grid_ascii"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | Array of equal-length strings representing pixel rows from top to bottom. | |
| offsetX | No | Top-left X offset on canvas (default: 0). | |
| offsetY | No | Top-left Y offset on canvas (default: 0). | |
| palette | Yes | Mapping of single character to hex color (e.g. {"#": "#1e1b2e", "R": "#e63946", ".": null}). | |
| clearLayer | No | Clear entire target layer before painting. | |
| layerIndex | No | Target 2D layer index (defaults to active layer). | |
| clearBackground | No | Erase "." or space characters that are not in palette. |