{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openbrandexchange.com/schemas/v0.3/Color.json",
  "type": "object",
  "title": "Color",
  "properties": {
    "code": {
      "type": "string",
      "description": "The brand's colour code, stable key (e.g. 'NVY', '001').",
      "minLength": 1,
      "maxLength": 64
    },
    "name": {
      "anyOf": [
        {
          "$ref": "LocalizedText.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "supplier_color": {
      "type": [
        "string",
        "null"
      ],
      "description": "Colour name as used in the brand's own systems/labels.",
      "maxLength": 200
    },
    "family": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "black",
            "white",
            "grey",
            "beige",
            "brown",
            "red",
            "pink",
            "orange",
            "yellow",
            "green",
            "blue",
            "purple",
            "gold",
            "silver",
            "multicolour",
            "transparent"
          ],
          "description": "Colour family for filters, next to the brand's own colour name. The same for every variant of one colour code."
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "code"
  ],
  "additionalProperties": false,
  "patternProperties": {
    "^x-[a-z0-9]+-[a-z0-9_-]+$": true
  }
}
