{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://chromaril.ca/specs/schema/v1/palette.schema.json",
  "title": "Chromaril Palette Document",
  "description": "A single color palette document (Chromaril v1).",
  "type": "object",
  "properties": {
    "chromaril": {
      "const": "1.0",
      "description": "Chromaril specification version."
    },
    "id": {
      "type": "string",
      "description": "Unique identifier for this palette."
    },
    "name": {
      "type": "string",
      "description": "Display name of the palette."
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$",
      "description": "URL-friendly slug derived from the palette name."
    },
    "description": {
      "type": "string",
      "description": "Human-readable description of the palette."
    },
    "author": {
      "$ref": "https://chromaril.ca/specs/schema/v1/definitions.schema.json#/$defs/author"
    },
    "license": {
      "type": "string",
      "description": "SPDX license identifier (e.g. CC-BY-4.0)."
    },
    "tags": {
      "$ref": "https://chromaril.ca/specs/schema/v1/definitions.schema.json#/$defs/tags"
    },
    "colors": {
      "type": "array",
      "description": "The colors in this palette.",
      "minItems": 1,
      "items": {
        "$ref": "https://chromaril.ca/specs/schema/v1/definitions.schema.json#/$defs/color"
      }
    },
    "variantDimensions": {
      "type": "object",
      "description": "Map of dimension name to variant names, summarizing the variant dimensions present.",
      "additionalProperties": {
        "type": "array",
        "items": { "type": "string" }
      }
    },
    "variants": {
      "type": "array",
      "description": "Named variants with alternate color sets.",
      "items": {
        "$ref": "https://chromaril.ca/specs/schema/v1/definitions.schema.json#/$defs/variant"
      }
    },
    "views": {
      "type": "array",
      "description": "Views (standard or embedded) for rendering the palette.",
      "items": {
        "$ref": "https://chromaril.ca/specs/schema/v1/definitions.schema.json#/$defs/view"
      }
    }
  },
  "required": ["chromaril", "id", "name", "colors"]
}
