# pub.leaflet.blocks.drawing

> Published by [leaflet.pub](https://lexicon.garden/identity/did:plc:btxrwcaeyodrap5mnjw2fvmz)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.blocks.drawing)
- [Documentation](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.blocks.drawing/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:btxrwcaeyodrap5mnjw2fvmz/pub.leaflet.blocks.drawing/examples)

## Definitions

### `pub.leaflet.blocks.drawing#fill`

**Type**: `object`

A filled polygon, painted with the nonzero rule: the region a stroke encloses.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `string` | Yes | A CSS hex color, or one of the document theme's colors: primary (text), accent, or tertiary (faded text). |
| `points` | `array` | Yes | Flattened vertices as x, y pairs in drawing space. The last joins back to the first. |

### `pub.leaflet.blocks.drawing`

**Type**: `object`

Freehand ink strokes. The view box is the area of drawing space the block shows, scaled to the block's width; strokes may reach past it.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `fills` | `array` | No | Painted in order, beneath the strokes. |
| `strokes` | `array` | Yes |  |
| `viewBox` | `ref` → `#viewBox` | Yes |  |

### `pub.leaflet.blocks.drawing#stroke`

**Type**: `object`

One pen stroke, drawn in order, rendered as a variable-width outline of its input points (as perfect-freehand does).

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `color` | `string` | Yes | A CSS hex color, or one of the document theme's colors: primary (text), accent, or tertiary (faded text). |
| `points` | `array` | Yes | Flattened input points as x, y, pressure triples: x and y in drawing space, pressure from 0 to 1000. |
| `simulatePressure` | `boolean` | No | The input had no real pressure (a mouse or finger); derive it from the stroke's speed instead. |
| `size` | `integer` | Yes | The stroke's base diameter in drawing space. |

### `pub.leaflet.blocks.drawing#viewBox`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `height` | `integer` | Yes |  |
| `width` | `integer` | Yes |  |
| `x` | `integer` | Yes |  |
| `y` | `integer` | Yes |  |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "fill": {
      "description": "A filled polygon, painted with the nonzero rule: the region a stroke encloses.",
      "properties": {
        "color": {
          "description": "A CSS hex color, or one of the document theme's colors: primary (text), accent, or tertiary (faded text).",
          "type": "string"
        },
        "points": {
          "description": "Flattened vertices as x, y pairs in drawing space. The last joins back to the first.",
          "items": {
            "type": "integer"
          },
          "type": "array"
        }
      },
      "required": [
        "points",
        "color"
      ],
      "type": "object"
    },
    "main": {
      "description": "Freehand ink strokes. The view box is the area of drawing space the block shows, scaled to the block's width; strokes may reach past it.",
      "properties": {
        "fills": {
          "description": "Painted in order, beneath the strokes.",
          "items": {
            "ref": "#fill",
            "type": "ref"
          },
          "type": "array"
        },
        "strokes": {
          "items": {
            "ref": "#stroke",
            "type": "ref"
          },
          "type": "array"
        },
        "viewBox": {
          "ref": "#viewBox",
          "type": "ref"
        }
      },
      "required": [
        "viewBox",
        "strokes"
      ],
      "type": "object"
    },
    "stroke": {
      "description": "One pen stroke, drawn in order, rendered as a variable-width outline of its input points (as perfect-freehand does).",
      "properties": {
        "color": {
          "description": "A CSS hex color, or one of the document theme's colors: primary (text), accent, or tertiary (faded text).",
          "type": "string"
        },
        "points": {
          "description": "Flattened input points as x, y, pressure triples: x and y in drawing space, pressure from 0 to 1000.",
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        "simulatePressure": {
          "description": "The input had no real pressure (a mouse or finger); derive it from the stroke's speed instead.",
          "type": "boolean"
        },
        "size": {
          "description": "The stroke's base diameter in drawing space.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "points",
        "color",
        "size"
      ],
      "type": "object"
    },
    "viewBox": {
      "properties": {
        "height": {
          "minimum": 1,
          "type": "integer"
        },
        "width": {
          "minimum": 1,
          "type": "integer"
        },
        "x": {
          "type": "integer"
        },
        "y": {
          "type": "integer"
        }
      },
      "required": [
        "x",
        "y",
        "width",
        "height"
      ],
      "type": "object"
    }
  },
  "id": "pub.leaflet.blocks.drawing",
  "lexicon": 1
}
```
