{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://gra.dient.art/schemas/gradient-art-v1.schema.json",
  "title": "GradientArt project file v1",
  "description": "Editable artwork, not a database backup. Clone graphs, formulas and aggregate limits also require semantic validation.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "version",
    "project"
  ],
  "properties": {
    "$schema": {
      "const": "https://gra.dient.art/schemas/gradient-art-v1.schema.json"
    },
    "format": {
      "const": "gradient-art"
    },
    "version": {
      "const": 1
    },
    "project": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "document",
        "backgrounds",
        "variables",
        "cloneSources"
      ],
      "properties": {
        "document": {
          "$ref": "#/$defs/document"
        },
        "backgrounds": {
          "type": "array",
          "minItems": 1,
          "maxItems": 60,
          "items": {
            "$ref": "#/$defs/node"
          }
        },
        "variables": {
          "$ref": "#/$defs/variables"
        },
        "cloneSources": {
          "type": "object",
          "maxProperties": 60,
          "additionalProperties": false,
          "patternProperties": {
            "^[a-zA-Z0-9_-]{1,64}$": {
              "$ref": "#/$defs/source"
            }
          }
        }
      }
    }
  },
  "$defs": {
    "node": {
      "anyOf": [
        {
          "$ref": "#/$defs/layer"
        },
        {
          "$ref": "#/$defs/folder"
        },
        {
          "$ref": "#/$defs/clone"
        }
      ]
    },
    "source": {
      "anyOf": [
        {
          "$ref": "#/$defs/layer"
        },
        {
          "$ref": "#/$defs/folder"
        }
      ]
    },
    "layer": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bindings": {
          "$ref": "#/$defs/background-bindings"
        },
        "name": {
          "type": "string"
        },
        "visible": {
          "type": "boolean"
        },
        "clipped": {
          "type": "boolean"
        },
        "blendMode": {
          "enum": [
            "normal",
            "multiply",
            "screen",
            "overlay",
            "darken",
            "lighten",
            "color-dodge",
            "color-burn",
            "hard-light",
            "soft-light",
            "difference",
            "exclusion",
            "hue",
            "saturation",
            "color",
            "luminosity"
          ]
        },
        "position": {
          "$ref": "#/$defs/number-pair"
        },
        "size": {
          "$ref": "#/$defs/size-pair"
        },
        "repeat": {
          "$ref": "#/$defs/repeat-pair"
        },
        "gradient": {
          "oneOf": [
            {
              "$ref": "#/$defs/gradient-guides"
            },
            {
              "$ref": "#/$defs/gradient-solid"
            },
            {
              "$ref": "#/$defs/gradient-linear"
            },
            {
              "$ref": "#/$defs/gradient-radial"
            },
            {
              "$ref": "#/$defs/gradient-conic"
            },
            {
              "$ref": "#/$defs/gradient-noise"
            },
            {
              "$ref": "#/$defs/gradient-pattern"
            },
            {
              "$ref": "#/$defs/gradient-shape"
            },
            {
              "$ref": "#/$defs/gradient-texture"
            },
            {
              "$ref": "#/$defs/gradient-text"
            }
          ]
        }
      },
      "required": [
        "name",
        "visible",
        "position",
        "size",
        "repeat",
        "gradient"
      ]
    },
    "folder": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "children",
        "transforms",
        "filters",
        "name",
        "visible"
      ],
      "properties": {
        "type": {
          "const": "element"
        },
        "name": {
          "type": "string"
        },
        "visible": {
          "type": "boolean"
        },
        "clipped": {
          "type": "boolean"
        },
        "blendMode": {
          "enum": [
            "normal",
            "multiply",
            "screen",
            "overlay",
            "darken",
            "lighten",
            "color-dodge",
            "color-burn",
            "hard-light",
            "soft-light",
            "difference",
            "exclusion",
            "hue",
            "saturation",
            "color",
            "luminosity"
          ]
        },
        "bounds": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "mode"
          ],
          "properties": {
            "mode": {
              "enum": [
                "auto",
                "fixed"
              ]
            },
            "left": {
              "type": "number"
            },
            "top": {
              "type": "number"
            },
            "width": {
              "type": "number",
              "minimum": 0
            },
            "height": {
              "type": "number",
              "minimum": 0
            }
          },
          "allOf": [
            {
              "if": {
                "properties": {
                  "mode": {
                    "const": "fixed"
                  }
                }
              },
              "then": {
                "required": [
                  "left",
                  "top",
                  "width",
                  "height"
                ]
              }
            }
          ]
        },
        "overflow": {
          "enum": [
            "visible",
            "hidden"
          ]
        },
        "boxShadows": {
          "type": "array",
          "maxItems": 32,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "x",
              "y",
              "blur",
              "spread",
              "color"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "y": {
                "type": "number"
              },
              "blur": {
                "type": "number",
                "minimum": 0
              },
              "spread": {
                "type": "number"
              },
              "color": {
                "$ref": "#/$defs/rgba"
              },
              "inset": {
                "type": "boolean"
              },
              "bindings": {
                "$ref": "#/$defs/shadow-bindings"
              },
              "easing": {
                "anyOf": [
                  {
                    "type": "array",
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    }
                  },
                  {
                    "const": "steps"
                  }
                ]
              },
              "steps": {
                "type": "integer",
                "minimum": 2,
                "maximum": 128
              }
            },
            "allOf": [
              {
                "if": {
                  "required": [
                    "steps"
                  ]
                },
                "then": {
                  "required": [
                    "easing"
                  ]
                }
              }
            ]
          }
        },
        "borderRadius": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "x",
            "y",
            "unit",
            "linked",
            "elliptical"
          ],
          "properties": {
            "x": {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number",
                "minimum": 0
              }
            },
            "y": {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number",
                "minimum": 0
              }
            },
            "unit": {
              "enum": [
                "px",
                "%"
              ]
            },
            "linked": {
              "type": "boolean"
            },
            "elliptical": {
              "type": "boolean"
            }
          }
        },
        "borders": {
          "$ref": "#/$defs/borders"
        },
        "filterChain": {
          "$ref": "#/$defs/filter-chain"
        },
        "filterTargets": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "blur": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "brightness": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "contrast": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "grayscale": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "hue": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "invert": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "opacity": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "saturate": {
              "enum": [
                "content",
                "backdrop"
              ]
            },
            "sepia": {
              "enum": [
                "content",
                "backdrop"
              ]
            }
          }
        },
        "children": {
          "type": "array",
          "maxItems": 60,
          "items": {
            "$ref": "#/$defs/node"
          }
        },
        "bindings": {
          "$ref": "#/$defs/element-bindings"
        },
        "transforms": {
          "$ref": "#/$defs/transforms"
        },
        "filters": {
          "$ref": "#/$defs/filters"
        }
      }
    },
    "clone": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "sourceId"
      ],
      "properties": {
        "type": {
          "const": "clone"
        },
        "sourceId": {
          "$ref": "#/$defs/variable-id"
        },
        "placement": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "position": {
              "$ref": "#/$defs/number-pair"
            },
            "size": {
              "$ref": "#/$defs/size-pair"
            },
            "transforms": {
              "$ref": "#/$defs/transforms"
            },
            "bounds": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "mode"
              ],
              "properties": {
                "mode": {
                  "enum": [
                    "auto",
                    "fixed"
                  ]
                },
                "left": {
                  "type": "number"
                },
                "top": {
                  "type": "number"
                },
                "width": {
                  "type": "number",
                  "minimum": 0
                },
                "height": {
                  "type": "number",
                  "minimum": 0
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "mode": {
                        "const": "fixed"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "left",
                      "top",
                      "width",
                      "height"
                    ]
                  }
                }
              ]
            },
            "overflow": {
              "enum": [
                "visible",
                "hidden"
              ]
            },
            "bindings": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "position.0": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "position.1": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "size.0": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "size.1": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "bounds.left": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "bounds.top": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "bounds.width": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "bounds.height": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.x": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.y": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.rotate": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.scaleX": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.scaleY": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.skewX": {
                  "$ref": "#/$defs/numeric-binding"
                },
                "transforms.skewY": {
                  "$ref": "#/$defs/numeric-binding"
                }
              }
            }
          }
        }
      }
    },
    "document": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bindings": {
          "$ref": "#/$defs/document-bindings"
        },
        "title": {
          "type": "string",
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "maxLength": 300
        },
        "keywords": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "type": "string",
            "maxLength": 25
          }
        },
        "width": {
          "type": "number",
          "minimum": 1
        },
        "height": {
          "type": "number",
          "minimum": 1
        }
      },
      "required": [
        "title",
        "description",
        "keywords",
        "width",
        "height"
      ]
    },
    "variables": {
      "type": "array",
      "maxItems": 64,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "type"
        ],
        "anyOf": [
          {
            "properties": {
              "type": {
                "const": "function"
              }
            },
            "required": [
              "expression"
            ]
          },
          {
            "properties": {
              "type": {
                "enum": [
                  "number",
                  "color",
                  "text"
                ]
              }
            },
            "required": [
              "defaultValue"
            ]
          }
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/variable-id"
          },
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]{0,63}$"
          },
          "label": {
            "type": "string",
            "maxLength": 100
          },
          "description": {
            "type": "string",
            "maxLength": 300
          },
          "type": {
            "enum": [
              "number",
              "color",
              "text",
              "function"
            ]
          },
          "expression": {
            "type": "string",
            "maxLength": 1024
          },
          "defaultValue": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "maxLength": 500,
                "pattern": "^[\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]*$"
              },
              {
                "type": "array",
                "minItems": 4,
                "maxItems": 4,
                "items": {
                  "type": "number"
                }
              }
            ]
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "step": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "exposed": {
            "type": "boolean"
          }
        }
      }
    },
    "font": {
      "type": "object",
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "family",
            "weights",
            "styles"
          ],
          "properties": {
            "id": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9][a-z0-9-]{0,99}$"
            },
            "family": {
              "type": "string",
              "minLength": 1,
              "maxLength": 150
            },
            "weights": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1000,
              "items": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000
              }
            },
            "styles": {
              "type": "array",
              "minItems": 1,
              "maxItems": 2,
              "items": {
                "enum": [
                  "normal",
                  "italic"
                ]
              }
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "id",
            "family",
            "version",
            "packageVersion",
            "weight",
            "style",
            "weights",
            "styles",
            "license",
            "files"
          ],
          "properties": {
            "id": {
              "type": "string",
              "maxLength": 100,
              "pattern": "^[a-z0-9][a-z0-9-]{0,99}$"
            },
            "family": {
              "type": "string",
              "minLength": 1,
              "maxLength": 150
            },
            "version": {
              "type": "string",
              "maxLength": 40
            },
            "packageVersion": {
              "type": "string",
              "maxLength": 40,
              "pattern": "^\\d+\\.\\d+\\.\\d+$"
            },
            "weight": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "style": {
              "enum": [
                "normal",
                "italic"
              ]
            },
            "weights": {
              "type": "array",
              "minItems": 1,
              "maxItems": 1000,
              "items": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000
              }
            },
            "styles": {
              "type": "array",
              "minItems": 1,
              "maxItems": 2,
              "items": {
                "enum": [
                  "normal",
                  "italic"
                ]
              }
            },
            "license": {
              "type": "string",
              "minLength": 1,
              "maxLength": 30000
            },
            "files": {
              "type": "array",
              "minItems": 1,
              "maxItems": 32,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "data",
                  "unicodeRange"
                ],
                "properties": {
                  "data": {
                    "type": "string",
                    "minLength": 64,
                    "maxLength": 1500000,
                    "pattern": "^d09GM[A-Za-z0-9+/]*={0,2}$"
                  },
                  "unicodeRange": {
                    "type": "string",
                    "maxLength": 30000,
                    "pattern": "^U\\+[0-9A-Fa-f]{1,6}(?:-[0-9A-Fa-f]{1,6})?(?:,\\s*U\\+[0-9A-Fa-f]{1,6}(?:-[0-9A-Fa-f]{1,6})?)*$"
                  }
                }
              }
            }
          }
        }
      ]
    },
    "borders": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "position"
      ],
      "properties": {
        "position": {
          "enum": [
            "inside",
            "center",
            "outside"
          ]
        },
        "top": {
          "$ref": "#/$defs/border-side"
        },
        "right": {
          "$ref": "#/$defs/border-side"
        },
        "bottom": {
          "$ref": "#/$defs/border-side"
        },
        "left": {
          "$ref": "#/$defs/border-side"
        }
      }
    },
    "border-side": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "width",
        "style",
        "color"
      ],
      "properties": {
        "width": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^;{}<>\\\\@]+$"
            }
          ]
        },
        "style": {
          "enum": [
            "none",
            "hidden",
            "solid",
            "dotted",
            "dashed",
            "double",
            "groove",
            "ridge",
            "inset",
            "outset",
            "waves",
            "squiggle",
            "sketch",
            "inherit",
            "initial",
            "unset",
            "revert",
            "revert-layer"
          ]
        },
        "color": {
          "anyOf": [
            {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number"
              }
            },
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^;{}<>\\\\@]+$"
            }
          ]
        },
        "dashArray": {
          "type": "array",
          "minItems": 1,
          "maxItems": 64,
          "items": {
            "type": "number",
            "minimum": 0
          }
        },
        "dashOffset": {
          "type": "number"
        },
        "amplitude": {
          "type": "number",
          "minimum": 0
        },
        "wavelength": {
          "type": "number",
          "minimum": 1
        },
        "roughness": {
          "type": "number",
          "minimum": 0
        }
      }
    },
    "gradient-guides": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "guides"
      ],
      "properties": {
        "type": {
          "const": "guides"
        },
        "guides": {
          "type": "array",
          "minItems": 0,
          "maxItems": 32,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "position",
              "angle",
              "spacing",
              "spread",
              "count"
            ],
            "properties": {
              "position": {
                "type": "array",
                "minItems": 2,
                "maxItems": 2,
                "items": {
                  "type": "number",
                  "minimum": -100000,
                  "maximum": 100000
                }
              },
              "angle": {
                "type": "number",
                "minimum": -36000,
                "maximum": 36000
              },
              "spacing": {
                "type": "number",
                "minimum": -100000,
                "maximum": 100000
              },
              "spread": {
                "type": "number",
                "minimum": -360,
                "maximum": 360
              },
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 32
              },
              "visible": {
                "type": "boolean"
              },
              "bindings": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "position.0": {
                    "$ref": "#/$defs/numeric-binding"
                  },
                  "position.1": {
                    "$ref": "#/$defs/numeric-binding"
                  },
                  "angle": {
                    "$ref": "#/$defs/numeric-binding"
                  },
                  "spacing": {
                    "$ref": "#/$defs/numeric-binding"
                  },
                  "spread": {
                    "$ref": "#/$defs/numeric-binding"
                  },
                  "count": {
                    "$ref": "#/$defs/numeric-binding"
                  }
                }
              }
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        }
      }
    },
    "gradient-solid": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "stops"
      ],
      "properties": {
        "type": {
          "const": "solid"
        },
        "stops": {
          "type": "array",
          "minItems": 1,
          "maxItems": 1,
          "items": {
            "$ref": "#/$defs/solid-stop"
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        }
      }
    },
    "gradient-linear": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "angle",
        "repeat",
        "stops"
      ],
      "properties": {
        "type": {
          "const": "linear"
        },
        "angle": {
          "type": "number"
        },
        "repeat": {
          "type": "number",
          "minimum": 1
        },
        "stops": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/stop"
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "angle": {
              "$ref": "#/$defs/numeric-binding"
            },
            "repeat": {
              "$ref": "#/$defs/numeric-binding"
            }
          }
        }
      }
    },
    "gradient-radial": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "shape",
        "position",
        "repeat",
        "stops"
      ],
      "properties": {
        "type": {
          "const": "radial"
        },
        "shape": {
          "enum": [
            "ellipse",
            "circle"
          ]
        },
        "position": {
          "$ref": "#/$defs/number-pair"
        },
        "repeat": {
          "type": "number",
          "minimum": 1
        },
        "stops": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/stop"
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "position.0": {
              "$ref": "#/$defs/numeric-binding"
            },
            "position.1": {
              "$ref": "#/$defs/numeric-binding"
            },
            "repeat": {
              "$ref": "#/$defs/numeric-binding"
            }
          }
        }
      }
    },
    "gradient-conic": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "angle",
        "position",
        "repeat",
        "stops"
      ],
      "properties": {
        "type": {
          "const": "conic"
        },
        "angle": {
          "type": "number"
        },
        "position": {
          "$ref": "#/$defs/number-pair"
        },
        "repeat": {
          "type": "number",
          "minimum": 1
        },
        "stops": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/stop"
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "angle": {
              "$ref": "#/$defs/numeric-binding"
            },
            "position.0": {
              "$ref": "#/$defs/numeric-binding"
            },
            "position.1": {
              "$ref": "#/$defs/numeric-binding"
            },
            "repeat": {
              "$ref": "#/$defs/numeric-binding"
            }
          }
        }
      }
    },
    "gradient-noise": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "noise"
      ],
      "properties": {
        "type": {
          "const": "noise"
        },
        "noise": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "enum": [
                "fractalNoise",
                "turbulence"
              ]
            },
            "colorMode": {
              "enum": [
                "color",
                "monochrome",
                "tint"
              ]
            },
            "tint": {
              "$ref": "#/$defs/color"
            },
            "baseFrequency": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            },
            "numOctaves": {
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            },
            "seed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 2147483647
            },
            "contrast": {
              "type": "number",
              "minimum": 0,
              "maximum": 4
            },
            "opacity": {
              "type": "number",
              "minimum": 0,
              "maximum": 1
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        }
      }
    },
    "gradient-pattern": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "pattern"
      ],
      "properties": {
        "type": {
          "const": "pattern"
        },
        "pattern": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "variant": {
              "enum": [
                "dots",
                "stripes",
                "grid",
                "checkerboard"
              ]
            },
            "foreground": {
              "$ref": "#/$defs/color"
            },
            "background": {
              "$ref": "#/$defs/color"
            },
            "spacing": {
              "type": "integer",
              "minimum": 4,
              "maximum": 100
            },
            "thickness": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "rotation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 360
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        }
      }
    },
    "gradient-shape": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "figure"
      ],
      "properties": {
        "type": {
          "const": "shape"
        },
        "figure": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "variant": {
              "enum": [
                "rectangle",
                "ellipse",
                "polygon",
                "star",
                "custom"
              ]
            },
            "join": {
              "enum": [
                "none",
                "unite",
                "subtract",
                "intersect",
                "exclude"
              ]
            },
            "joins": {
              "type": "array",
              "maxItems": 64,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "mode",
                  "paths"
                ],
                "properties": {
                  "mode": {
                    "enum": [
                      "unite",
                      "subtract",
                      "intersect",
                      "exclude"
                    ]
                  },
                  "paths": {
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 128,
                    "uniqueItems": true,
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 127
                    }
                  }
                }
              }
            },
            "pathGroups": {
              "type": "array",
              "maxItems": 64,
              "items": {
                "type": "array",
                "minItems": 2,
                "maxItems": 128,
                "uniqueItems": true,
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 127
                }
              }
            },
            "fill": {
              "$ref": "#/$defs/color"
            },
            "stroke": {
              "$ref": "#/$defs/color"
            },
            "strokeWidth": {
              "type": "integer",
              "minimum": 0,
              "maximum": 30
            },
            "rotation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 360
            },
            "cornerRadius": {
              "type": "integer",
              "minimum": 0,
              "maximum": 90
            },
            "sides": {
              "type": "integer",
              "minimum": 3,
              "maximum": 32
            },
            "points": {
              "type": "integer",
              "minimum": 3,
              "maximum": 32
            },
            "innerRadius": {
              "type": "integer",
              "minimum": 1,
              "maximum": 99
            },
            "strokeMatrix": {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number",
                "minimum": -1000000000,
                "maximum": 1000000000
              }
            },
            "path": {
              "type": "string",
              "maxLength": 4096,
              "pattern": "^[MmLlHhVvCcSsQqTtAaZz0-9eE+.,\\s-]+$"
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "figure.fill": {
              "anyOf": [
                {
                  "$ref": "#/$defs/variable-id"
                }
              ]
            },
            "figure.stroke": {
              "anyOf": [
                {
                  "$ref": "#/$defs/variable-id"
                }
              ]
            },
            "figure.strokeWidth": {
              "$ref": "#/$defs/numeric-binding"
            },
            "figure.rotation": {
              "$ref": "#/$defs/numeric-binding"
            }
          }
        }
      }
    },
    "gradient-texture": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "texture"
      ],
      "properties": {
        "type": {
          "const": "texture"
        },
        "texture": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "preset": {
              "enum": [
                "paper",
                "clouds",
                "marble",
                "wood"
              ]
            },
            "scale": {
              "type": "number",
              "minimum": 0.25,
              "maximum": 4
            },
            "distortion": {
              "type": "integer",
              "minimum": 0,
              "maximum": 80
            },
            "contrast": {
              "type": "number",
              "minimum": 0,
              "maximum": 4
            },
            "seed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 65535
            },
            "foreground": {
              "$ref": "#/$defs/color"
            },
            "background": {
              "$ref": "#/$defs/color"
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {}
        }
      }
    },
    "gradient-text": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type",
        "text"
      ],
      "properties": {
        "type": {
          "const": "text"
        },
        "text": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "content": {
              "type": "string",
              "maxLength": 500,
              "pattern": "^[\\u0009\\u000A\\u000D\\u0020-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]*$"
            },
            "weight": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "style": {
              "enum": [
                "normal",
                "italic"
              ]
            },
            "font": {
              "$ref": "#/$defs/font"
            },
            "alignment": {
              "enum": [
                "left",
                "center",
                "right"
              ]
            },
            "fill": {
              "$ref": "#/$defs/color"
            },
            "stroke": {
              "$ref": "#/$defs/color"
            },
            "fontSize": {
              "type": "integer",
              "minimum": 4,
              "maximum": 160
            },
            "letterSpacing": {
              "type": "number",
              "minimum": -10,
              "maximum": 40
            },
            "strokeWidth": {
              "type": "number",
              "minimum": 0,
              "maximum": 10
            },
            "rotation": {
              "type": "integer",
              "minimum": 0,
              "maximum": 360
            },
            "box": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "width",
                "height"
              ],
              "properties": {
                "width": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 1000000000
                },
                "height": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 1000000000
                }
              }
            }
          }
        },
        "bindings": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "text.content": {
              "anyOf": [
                {
                  "$ref": "#/$defs/variable-id"
                }
              ]
            },
            "text.fontSize": {
              "$ref": "#/$defs/numeric-binding"
            },
            "text.letterSpacing": {
              "$ref": "#/$defs/numeric-binding"
            },
            "text.strokeWidth": {
              "$ref": "#/$defs/numeric-binding"
            },
            "text.fill": {
              "anyOf": [
                {
                  "$ref": "#/$defs/variable-id"
                }
              ]
            },
            "text.stroke": {
              "anyOf": [
                {
                  "$ref": "#/$defs/variable-id"
                }
              ]
            }
          }
        }
      }
    },
    "color": {
      "type": [
        "array",
        "null"
      ],
      "minItems": 4,
      "maxItems": 4,
      "items": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      ]
    },
    "rgba": {
      "type": "array",
      "minItems": 4,
      "maxItems": 4,
      "items": [
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 255
        },
        {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      ]
    },
    "number-pair": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "number"
      }
    },
    "size-pair": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "number",
        "minimum": 0
      }
    },
    "repeat-pair": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "boolean"
      }
    },
    "variable-id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,64}$"
    },
    "numeric-binding": {
      "anyOf": [
        {
          "$ref": "#/$defs/variable-id"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "expression"
          ],
          "properties": {
            "expression": {
              "type": "string",
              "maxLength": 1024
            }
          }
        }
      ]
    },
    "stop": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bindings": {
          "$ref": "#/$defs/stop-bindings"
        },
        "color": {
          "$ref": "#/$defs/color"
        },
        "position": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "easing": {
          "anyOf": [
            {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            {
              "const": "steps"
            }
          ]
        },
        "steps": {
          "type": "integer",
          "minimum": 2,
          "maximum": 128
        }
      },
      "allOf": [
        {
          "if": {
            "required": [
              "easing"
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "color"
                  ]
                },
                {
                  "required": [
                    "position"
                  ]
                },
                {
                  "required": [
                    "bindings"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "steps"
            ]
          },
          "then": {
            "required": [
              "easing"
            ]
          }
        },
        {
          "if": {
            "required": [
              "color"
            ],
            "properties": {
              "color": {
                "type": "array"
              }
            }
          },
          "then": {
            "required": [
              "position"
            ]
          }
        }
      ],
      "anyOf": [
        {
          "required": [
            "position"
          ]
        },
        {
          "required": [
            "easing"
          ]
        }
      ]
    },
    "solid-stop": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bindings": {
          "$ref": "#/$defs/stop-bindings"
        },
        "color": {
          "$ref": "#/$defs/rgba"
        },
        "position": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "easing": {
          "anyOf": [
            {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "items": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            {
              "const": "steps"
            }
          ]
        },
        "steps": {
          "type": "integer",
          "minimum": 2,
          "maximum": 128
        }
      },
      "allOf": [
        {
          "if": {
            "required": [
              "easing"
            ]
          },
          "then": {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "color"
                  ]
                },
                {
                  "required": [
                    "position"
                  ]
                },
                {
                  "required": [
                    "bindings"
                  ]
                }
              ]
            }
          }
        },
        {
          "if": {
            "required": [
              "steps"
            ]
          },
          "then": {
            "required": [
              "easing"
            ]
          }
        },
        {
          "if": {
            "required": [
              "color"
            ],
            "properties": {
              "color": {
                "type": "array"
              }
            }
          },
          "then": {
            "required": [
              "position"
            ]
          }
        }
      ],
      "anyOf": [
        {
          "required": [
            "position"
          ]
        },
        {
          "required": [
            "easing"
          ]
        }
      ],
      "required": [
        "color",
        "position"
      ]
    },
    "transforms": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "x",
        "y",
        "rotate",
        "scaleX",
        "scaleY",
        "skewX",
        "skewY"
      ],
      "properties": {
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "rotate": {
          "type": "number"
        },
        "scaleX": {
          "type": "number"
        },
        "scaleY": {
          "type": "number"
        },
        "skewX": {
          "type": "number",
          "minimum": -89,
          "maximum": 89
        },
        "skewY": {
          "type": "number",
          "minimum": -89,
          "maximum": 89
        }
      }
    },
    "filters": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "blur",
        "brightness",
        "contrast",
        "grayscale",
        "hue",
        "invert",
        "opacity",
        "saturate",
        "sepia",
        "shadow",
        "shadowX",
        "shadowY",
        "shadowBlur",
        "shadowColor"
      ],
      "properties": {
        "blur": {
          "type": "number",
          "minimum": 0
        },
        "brightness": {
          "type": "number",
          "minimum": 0
        },
        "contrast": {
          "type": "number",
          "minimum": 0
        },
        "grayscale": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "hue": {
          "type": "number"
        },
        "invert": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "opacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "saturate": {
          "type": "number",
          "minimum": 0
        },
        "sepia": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "shadowX": {
          "type": "number"
        },
        "shadowY": {
          "type": "number"
        },
        "shadowBlur": {
          "type": "number",
          "minimum": 0
        },
        "shadowColor": {
          "$ref": "#/$defs/rgba"
        },
        "shadow": {
          "type": "boolean"
        }
      }
    },
    "filter-chain": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "value"
        ],
        "properties": {
          "id": {
            "$ref": "#/$defs/variable-id"
          },
          "type": {
            "enum": [
              "blur",
              "brightness",
              "contrast",
              "grayscale",
              "hue",
              "invert",
              "opacity",
              "saturate",
              "sepia"
            ]
          },
          "value": {
            "type": "number"
          },
          "backdrop": {
            "type": "boolean"
          },
          "bindings": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "value": {
                "$ref": "#/$defs/numeric-binding"
              }
            }
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "type": {
                  "const": "blur"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "brightness"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "contrast"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "grayscale"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "invert"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "opacity"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "saturate"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "const": "sepia"
                }
              }
            },
            "then": {
              "properties": {
                "value": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                }
              }
            }
          }
        ]
      }
    },
    "document-bindings": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "height": {
          "$ref": "#/$defs/numeric-binding"
        }
      }
    },
    "background-bindings": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "position.0": {
          "$ref": "#/$defs/numeric-binding"
        },
        "position.1": {
          "$ref": "#/$defs/numeric-binding"
        },
        "size.0": {
          "$ref": "#/$defs/numeric-binding"
        },
        "size.1": {
          "$ref": "#/$defs/numeric-binding"
        }
      }
    },
    "element-bindings": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "bounds.left": {
          "$ref": "#/$defs/numeric-binding"
        },
        "bounds.top": {
          "$ref": "#/$defs/numeric-binding"
        },
        "bounds.width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "bounds.height": {
          "$ref": "#/$defs/numeric-binding"
        },
        "borders.top.width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "borders.top.color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        },
        "borders.right.width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "borders.right.color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        },
        "borders.bottom.width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "borders.bottom.color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        },
        "borders.left.width": {
          "$ref": "#/$defs/numeric-binding"
        },
        "borders.left.color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        },
        "transforms.x": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.y": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.rotate": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.scaleX": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.scaleY": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.skewX": {
          "$ref": "#/$defs/numeric-binding"
        },
        "transforms.skewY": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.blur": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.brightness": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.contrast": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.grayscale": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.hue": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.invert": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.opacity": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.saturate": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.sepia": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.shadowX": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.shadowY": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.shadowBlur": {
          "$ref": "#/$defs/numeric-binding"
        },
        "filters.shadowColor": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        }
      }
    },
    "stop-bindings": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        },
        "position": {
          "$ref": "#/$defs/numeric-binding"
        }
      }
    },
    "shadow-bindings": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "x": {
          "$ref": "#/$defs/numeric-binding"
        },
        "y": {
          "$ref": "#/$defs/numeric-binding"
        },
        "blur": {
          "$ref": "#/$defs/numeric-binding"
        },
        "spread": {
          "$ref": "#/$defs/numeric-binding"
        },
        "color": {
          "anyOf": [
            {
              "$ref": "#/$defs/variable-id"
            }
          ]
        }
      }
    }
  }
}
