fill_pattern
Fills a rectangle with a two-color ordered Bayer dither, controlling density and matrix size while clipping the pattern to the canvas for pixel-art shading.
Instructions
Fill rect with an ordered dither of two colours (clipped to the canvas).
A pixel gets color_b when the Bayer threshold (v + 0.5) / n^2 at its canvas position is below density, color_a otherwise: 0 is all color_a, 1 all color_b. The matrix is anchored at canvas (0, 0), so separate fills tile seamlessly; with bayer2 and density 0.5, color_b lands where x + y is even.
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>",
"color_a": "<color_a>",
"color_b": "<color_b>",
"density": "<density>"
},
"name": "fill_pattern"
}
}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 | |
| matrix | No | Bayer matrix size of the pattern | bayer4 |
| color_a | Yes | '#RRGGBB', '#RRGGBBAA' or 'transparent' | |
| color_b | Yes | '#RRGGBB', '#RRGGBBAA' or 'transparent' | |
| density | Yes | Share of pixels that get color_b | |
| create_cel | No | Add an empty cel when the layer has none in that frame |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||