# PANL Specification v0.1

Pixel Art Notation Language defines deterministic, anti-aliased-free isometric pixel art assets.

## Canonical Endpoints

- Human-readable: `/docs`
- Machine-readable JSON: `/docs/panl.json`
- Markdown export: `/docs/panl.md`

## Document Structure

```json
{
  "version": "0.1",
  "canvas": { "width": 256, "height": 256 },
  "palette": { "colors": { "name": "#RRGGBB" } },
  "seed": 42,
  "definitions": { "name": { "type": "..." } },
  "asset": { "id": "asset_id", "commands": [{ "type": "..." }] }
}
```

## Root Commands

### `Root Spec`

- Signature: `{ version, canvas, palette?, seed?, definitions?, asset }`
- Summary: Top-level document for a single asset render.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `version` | `string` | yes | Notation version tag, currently "0.1". |
| `canvas` | `{ width: int, height: int }` | yes | Fixed output canvas size. |
| `palette` | `{ colors: Record<string, hex> }` | no | Named colors referenced via @token. |
| `seed` | `int` | no | Required when dither is used. |
| `definitions` | `Record<string, command>` | no | Reusable named command definitions. |
| `asset` | `{ id: string, commands: command[] }` | yes | Asset identifier and render command list. |

Notes:
- Commands are rendered in array order.
- Warnings do not block PNG export.

## Primitive Commands

### `iso_prism`

- Signature: `iso_prism(x, y, w, h, depth, topFill, leftFill, rightFill, outline?)`
- Summary: Isometric block primitive with top, left, and right faces.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `x` | `int` | yes | Top-face center X coordinate. |
| `y` | `int` | yes | Top-face center Y coordinate. |
| `w` | `int (even)` | yes | Top-face width. |
| `h` | `int (even)` | yes | Top-face height. |
| `depth` | `int >= 1` | yes | Prism vertical depth. |
| `topFill/leftFill/rightFill` | `color` | yes | Face fill colors. |
| `outline` | `color` | no | Optional outline color. |
| `transform` | `transform` | no | translate / flip transforms. |
| `dither` | `dither` | no | Checker overlay on top face. |

### `iso_tile`

- Signature: `iso_tile(x, y, w, h, fill, outline?)`
- Summary: Flat isometric diamond (top-face only).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `x` | `int` | yes | Diamond center X. |
| `y` | `int` | yes | Diamond top Y. |
| `w` | `int (even)` | yes | Diamond width. |
| `h` | `int (even)` | yes | Diamond height. |
| `fill` | `color` | yes | Fill color. |
| `outline` | `color` | no | Optional edge color. |
| `transform` | `transform` | no | translate / flip transforms. |
| `dither` | `dither` | no | Checker overlay. |

### `rect`

- Signature: `rect(x, y, w, h, fill? | stroke?)`
- Summary: Axis-aligned rectangle primitive.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `x,y` | `int` | yes | Top-left corner. |
| `w,h` | `int >= 1` | yes | Dimensions. |
| `fill` | `color` | no | Fill color (required if stroke missing). |
| `stroke` | `color` | no | Stroke color (required if fill missing). |
| `strokeWidth` | `int >= 1` | no | Stroke width. |
| `transform` | `transform` | no | translate / flip transforms. |

### `line`

- Signature: `line(x1, y1, x2, y2, color, width?)`
- Summary: Integer-based raster line primitive.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `x1,y1,x2,y2` | `int` | yes | Line endpoints. |
| `color` | `color` | yes | Line color. |
| `width` | `int >= 1` | no | Line width. |
| `transform` | `transform` | no | translate / flip transforms. |

### `polygon`

- Signature: `polygon(points, fill? | stroke?)`
- Summary: Custom polygon primitive with integer points.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `points` | `Array<{x:int,y:int}>` | yes | At least 3 points. |
| `fill` | `color` | no | Fill color (required if stroke missing). |
| `stroke` | `color` | no | Stroke color (required if fill missing). |
| `strokeWidth` | `int >= 1` | no | Stroke width. |
| `transform` | `transform` | no | translate / flip transforms. |

### `use`

- Signature: `use(ref, transform?, overrides?)`
- Summary: Reference a named definition and apply allowed overrides.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `ref` | `string` | yes | Definition name to reuse. |
| `transform` | `transform` | no | Per-instance transform. |
| `overrides.colors` | `Record<string, color>` | no | Allowed color key overrides only. |
| `overrides.transform` | `transform` | no | Additional transform override. |

Notes:
- Geometry overrides are blocked in v1 by parser rules.

## Helper Commands

### `color`

- Signature: `hex | @paletteToken`
- Summary: Color input accepted by draw commands.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `hex` | `#RRGGBB \| #RRGGBBAA` | yes | Direct color literal. |
| `@name` | `palette reference` | no | Lookup in palette.colors. |

### `transform`

- Signature: `{ translateX?, translateY?, flipX?, flipY? }`
- Summary: Integer transform properties applied in local coordinates.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `translateX` | `int` | no | Horizontal translation. |
| `translateY` | `int` | no | Vertical translation. |
| `flipX` | `boolean` | no | Mirror around local origin on X. |
| `flipY` | `boolean` | no | Mirror around local origin on Y. |

### `dither`

- Signature: `{ pattern: "checker", color, offsetX?, offsetY? }`
- Summary: Optional checker overlay for selected primitives.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `pattern` | `"checker"` | yes | Current v1 supported pattern. |
| `color` | `color` | yes | Overlay color. |
| `offsetX/offsetY` | `int` | no | Pattern phase offsets. |

## JSON Schema

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://pane.dev/schemas/panl-0.1.schema.json",
  "title": "PANL Asset Spec",
  "description": "Pixel Art Notation Language (PANL) v0.1 asset document schema.",
  "type": "object",
  "properties": {
    "version": {
      "type": "string",
      "minLength": 1
    },
    "canvas": {
      "type": "object",
      "properties": {
        "width": {
          "type": "integer",
          "minimum": 16,
          "maximum": 1024
        },
        "height": {
          "type": "integer",
          "minimum": 16,
          "maximum": 1024
        }
      },
      "required": [
        "width",
        "height"
      ],
      "additionalProperties": false
    },
    "palette": {
      "type": "object",
      "properties": {
        "colors": {
          "type": "object",
          "patternProperties": {
            "^[A-Za-z_][A-Za-z0-9_]*$": {
              "type": "string",
              "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "colors"
      ],
      "nullable": true,
      "additionalProperties": false
    },
    "seed": {
      "type": "integer",
      "nullable": true
    },
    "definitions": {
      "type": "object",
      "nullable": true,
      "additionalProperties": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "iso_tile"
              },
              "x": {
                "type": "integer"
              },
              "y": {
                "type": "integer"
              },
              "w": {
                "type": "integer",
                "minimum": 2,
                "multipleOf": 2
              },
              "h": {
                "type": "integer",
                "minimum": 2,
                "multipleOf": 2
              },
              "fill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "outline": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "dither": {
                "type": "object",
                "properties": {
                  "pattern": {
                    "type": "string",
                    "enum": [
                      "checker"
                    ]
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "offsetX": {
                    "type": "integer"
                  },
                  "offsetY": {
                    "type": "integer"
                  }
                },
                "required": [
                  "pattern",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "x",
              "y",
              "w",
              "h",
              "fill"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "iso_prism"
              },
              "x": {
                "type": "integer"
              },
              "y": {
                "type": "integer"
              },
              "w": {
                "type": "integer",
                "minimum": 2,
                "multipleOf": 2
              },
              "h": {
                "type": "integer",
                "minimum": 2,
                "multipleOf": 2
              },
              "depth": {
                "type": "integer",
                "minimum": 1
              },
              "topFill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "leftFill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "rightFill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "outline": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "dither": {
                "type": "object",
                "properties": {
                  "pattern": {
                    "type": "string",
                    "enum": [
                      "checker"
                    ]
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "offsetX": {
                    "type": "integer"
                  },
                  "offsetY": {
                    "type": "integer"
                  }
                },
                "required": [
                  "pattern",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "x",
              "y",
              "w",
              "h",
              "depth",
              "topFill",
              "leftFill",
              "rightFill"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "rect"
              },
              "x": {
                "type": "integer"
              },
              "y": {
                "type": "integer"
              },
              "w": {
                "type": "integer",
                "minimum": 1
              },
              "h": {
                "type": "integer",
                "minimum": 1
              },
              "fill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "stroke": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "strokeWidth": {
                "type": "integer",
                "minimum": 1
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "dither": {
                "type": "object",
                "properties": {
                  "pattern": {
                    "type": "string",
                    "enum": [
                      "checker"
                    ]
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "offsetX": {
                    "type": "integer"
                  },
                  "offsetY": {
                    "type": "integer"
                  }
                },
                "required": [
                  "pattern",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "x",
              "y",
              "w",
              "h"
            ],
            "anyOf": [
              {
                "required": [
                  "fill"
                ]
              },
              {
                "required": [
                  "stroke"
                ]
              }
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "line"
              },
              "x1": {
                "type": "integer"
              },
              "y1": {
                "type": "integer"
              },
              "x2": {
                "type": "integer"
              },
              "y2": {
                "type": "integer"
              },
              "color": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "width": {
                "type": "integer",
                "minimum": 1
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "dither": {
                "type": "object",
                "properties": {
                  "pattern": {
                    "type": "string",
                    "enum": [
                      "checker"
                    ]
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "offsetX": {
                    "type": "integer"
                  },
                  "offsetY": {
                    "type": "integer"
                  }
                },
                "required": [
                  "pattern",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "x1",
              "y1",
              "x2",
              "y2",
              "color"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "polygon"
              },
              "points": {
                "type": "array",
                "minItems": 3,
                "items": {
                  "type": "object",
                  "properties": {
                    "x": {
                      "type": "integer"
                    },
                    "y": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "x",
                    "y"
                  ],
                  "additionalProperties": false
                }
              },
              "fill": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "stroke": {
                "type": "string",
                "anyOf": [
                  {
                    "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                  },
                  {
                    "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                  }
                ]
              },
              "strokeWidth": {
                "type": "integer",
                "minimum": 1
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "dither": {
                "type": "object",
                "properties": {
                  "pattern": {
                    "type": "string",
                    "enum": [
                      "checker"
                    ]
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "offsetX": {
                    "type": "integer"
                  },
                  "offsetY": {
                    "type": "integer"
                  }
                },
                "required": [
                  "pattern",
                  "color"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "points"
            ],
            "anyOf": [
              {
                "required": [
                  "fill"
                ]
              },
              {
                "required": [
                  "stroke"
                ]
              }
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "const": "use"
              },
              "ref": {
                "type": "string",
                "minLength": 1
              },
              "transform": {
                "type": "object",
                "properties": {
                  "translateX": {
                    "type": "integer"
                  },
                  "translateY": {
                    "type": "integer"
                  },
                  "flipX": {
                    "type": "boolean"
                  },
                  "flipY": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              },
              "overrides": {
                "type": "object",
                "properties": {
                  "colors": {
                    "type": "object",
                    "patternProperties": {
                      "^[A-Za-z_][A-Za-z0-9_]*$": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "required": [
              "type",
              "ref"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "asset": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "commands": {
          "type": "array",
          "minItems": 1,
          "maxItems": 2000,
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "iso_tile"
                  },
                  "x": {
                    "type": "integer"
                  },
                  "y": {
                    "type": "integer"
                  },
                  "w": {
                    "type": "integer",
                    "minimum": 2,
                    "multipleOf": 2
                  },
                  "h": {
                    "type": "integer",
                    "minimum": 2,
                    "multipleOf": 2
                  },
                  "fill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "outline": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "dither": {
                    "type": "object",
                    "properties": {
                      "pattern": {
                        "type": "string",
                        "enum": [
                          "checker"
                        ]
                      },
                      "color": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      },
                      "offsetX": {
                        "type": "integer"
                      },
                      "offsetY": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "pattern",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "x",
                  "y",
                  "w",
                  "h",
                  "fill"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "iso_prism"
                  },
                  "x": {
                    "type": "integer"
                  },
                  "y": {
                    "type": "integer"
                  },
                  "w": {
                    "type": "integer",
                    "minimum": 2,
                    "multipleOf": 2
                  },
                  "h": {
                    "type": "integer",
                    "minimum": 2,
                    "multipleOf": 2
                  },
                  "depth": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "topFill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "leftFill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "rightFill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "outline": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "dither": {
                    "type": "object",
                    "properties": {
                      "pattern": {
                        "type": "string",
                        "enum": [
                          "checker"
                        ]
                      },
                      "color": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      },
                      "offsetX": {
                        "type": "integer"
                      },
                      "offsetY": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "pattern",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "x",
                  "y",
                  "w",
                  "h",
                  "depth",
                  "topFill",
                  "leftFill",
                  "rightFill"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "rect"
                  },
                  "x": {
                    "type": "integer"
                  },
                  "y": {
                    "type": "integer"
                  },
                  "w": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "h": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "fill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "stroke": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "strokeWidth": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "dither": {
                    "type": "object",
                    "properties": {
                      "pattern": {
                        "type": "string",
                        "enum": [
                          "checker"
                        ]
                      },
                      "color": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      },
                      "offsetX": {
                        "type": "integer"
                      },
                      "offsetY": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "pattern",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "x",
                  "y",
                  "w",
                  "h"
                ],
                "anyOf": [
                  {
                    "required": [
                      "fill"
                    ]
                  },
                  {
                    "required": [
                      "stroke"
                    ]
                  }
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "line"
                  },
                  "x1": {
                    "type": "integer"
                  },
                  "y1": {
                    "type": "integer"
                  },
                  "x2": {
                    "type": "integer"
                  },
                  "y2": {
                    "type": "integer"
                  },
                  "color": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "width": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "dither": {
                    "type": "object",
                    "properties": {
                      "pattern": {
                        "type": "string",
                        "enum": [
                          "checker"
                        ]
                      },
                      "color": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      },
                      "offsetX": {
                        "type": "integer"
                      },
                      "offsetY": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "pattern",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "x1",
                  "y1",
                  "x2",
                  "y2",
                  "color"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "polygon"
                  },
                  "points": {
                    "type": "array",
                    "minItems": 3,
                    "items": {
                      "type": "object",
                      "properties": {
                        "x": {
                          "type": "integer"
                        },
                        "y": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "x",
                        "y"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "fill": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "stroke": {
                    "type": "string",
                    "anyOf": [
                      {
                        "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                      },
                      {
                        "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  },
                  "strokeWidth": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "dither": {
                    "type": "object",
                    "properties": {
                      "pattern": {
                        "type": "string",
                        "enum": [
                          "checker"
                        ]
                      },
                      "color": {
                        "type": "string",
                        "anyOf": [
                          {
                            "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                          },
                          {
                            "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                          }
                        ]
                      },
                      "offsetX": {
                        "type": "integer"
                      },
                      "offsetY": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "pattern",
                      "color"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "points"
                ],
                "anyOf": [
                  {
                    "required": [
                      "fill"
                    ]
                  },
                  {
                    "required": [
                      "stroke"
                    ]
                  }
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "const": "use"
                  },
                  "ref": {
                    "type": "string",
                    "minLength": 1
                  },
                  "transform": {
                    "type": "object",
                    "properties": {
                      "translateX": {
                        "type": "integer"
                      },
                      "translateY": {
                        "type": "integer"
                      },
                      "flipX": {
                        "type": "boolean"
                      },
                      "flipY": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "overrides": {
                    "type": "object",
                    "properties": {
                      "colors": {
                        "type": "object",
                        "patternProperties": {
                          "^[A-Za-z_][A-Za-z0-9_]*$": {
                            "type": "string",
                            "anyOf": [
                              {
                                "pattern": "^#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$"
                              },
                              {
                                "pattern": "^@[A-Za-z_][A-Za-z0-9_]*$"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "transform": {
                        "type": "object",
                        "properties": {
                          "translateX": {
                            "type": "integer"
                          },
                          "translateY": {
                            "type": "integer"
                          },
                          "flipX": {
                            "type": "boolean"
                          },
                          "flipY": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "type",
                  "ref"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "id",
        "commands"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version",
    "canvas",
    "asset"
  ],
  "additionalProperties": false
}
```