fill_area
Fill connected pixel areas with color using paint bucket functionality for pixel art projects.
Instructions
Fill a connected area with a color (paint bucket)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project identifier | |
| layerIndex | No | Layer index (default: 0) | |
| frameIndex | No | Frame index (default: 0) | |
| x | Yes | X coordinate to start fill | |
| y | Yes | Y coordinate to start fill | |
| color | Yes | Fill color in hex format |
Implementation Reference
- src/server/PiskelServer.ts:1129-1140 (handler)The tool handler 'fillAreaTool' inside PiskelServer that interfaces with the business logic.
private fillAreaTool( projectId: string, layerIndex: number, frameIndex: number, x: number, y: number, color: string ): object { const frame = this.getFrame(projectId, layerIndex, frameIndex); const count = fillArea(frame, x, y, color); return { success: true, pixelsFilled: count }; } - src/tools/drawing.ts:214-222 (handler)The core business logic function 'fillArea' that performs the actual flood fill.
export function fillArea( frame: Frame, x: number, y: number, color: number | string ): number { const filled = floodFill(frame, x, y, color); return filled.length; } - src/server/PiskelServer.ts:457-474 (registration)MCP tool registration for 'fill_area'.
{ name: 'fill_area', description: 'Fill a connected area with a color (paint bucket)', inputSchema: { type: 'object', properties: { projectId: { type: 'string', description: 'Project identifier', }, layerIndex: { type: 'number', description: 'Layer index (default: 0)', }, frameIndex: { type: 'number', description: 'Frame index (default: 0)', },