{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Colourful Tab Extension",
  "description": "Settings for jupyterlab_colourful_tab_extension",
  "type": "object",
  "jupyter.lab.menus": {
    "context": [
      {
        "type": "submenu",
        "selector": "#jp-main-dock-panel .lm-DockPanel-tabBar .lm-TabBar-tab",
        "rank": 100,
        "submenu": {
          "id": "jp-contextmenu-colourful-tab",
          "label": "Tab Colour",
          "items": [
            { "command": "colourful-tab:set-rose" },
            { "command": "colourful-tab:set-peach" },
            { "command": "colourful-tab:set-lemon" },
            { "command": "colourful-tab:set-mint" },
            { "command": "colourful-tab:set-sky" },
            { "command": "colourful-tab:set-lavender" },
            { "type": "separator" },
            { "command": "colourful-tab:clear" }
          ]
        }
      }
    ]
  },
  "properties": {
    "dynamicDivider": {
      "title": "Dynamic divider between same-coloured tabs",
      "description": "When two adjacent inactive tabs share the same colour, recolour the 1px divider between them with a computed contrastive grey (darker in the light theme, brighter in the dark theme) so the tabs stay visually separate.",
      "type": "boolean",
      "default": true
    },
    "dividerContrast": {
      "title": "Divider contrast",
      "description": "Strength of the divider grey between adjacent inactive same-coloured tabs: low targets 2:1 (a subtle hairline), medium 3:1 (the WCAG non-text minimum), high 4:1 (strongest separation).",
      "type": "string",
      "enum": ["low", "medium", "high"],
      "default": "medium"
    },
    "palette": {
      "title": "Tab colour palette",
      "description": "Inactive and active shades per colour name, for the light and dark themes. Hex format #rrggbb. Divider greys are recomputed automatically from these values.",
      "$ref": "#/definitions/palette",
      "default": {
        "light": {
          "rose": { "inactive": "#e8bbc6", "active": "#e39fb1" },
          "peach": { "inactive": "#ddc2a7", "active": "#d2ab82" },
          "lemon": { "inactive": "#ccc8a6", "active": "#bab56d" },
          "mint": { "inactive": "#b3cdb1", "active": "#87c086" },
          "sky": { "inactive": "#a5cce5", "active": "#77bae0" },
          "lavender": { "inactive": "#cfc1e1", "active": "#bfa9da" }
        },
        "dark": {
          "rose": { "inactive": "#4e3138", "active": "#3a2328" },
          "peach": { "inactive": "#4e4032", "active": "#3a3126" },
          "lemon": { "inactive": "#4e4b32", "active": "#3a3825" },
          "mint": { "inactive": "#324e37", "active": "#253b2a" },
          "sky": { "inactive": "#28394d", "active": "#1d2a38" },
          "lavender": { "inactive": "#40324e", "active": "#30253a" }
        }
      }
    }
  },
  "definitions": {
    "palette": {
      "type": "object",
      "properties": {
        "light": { "$ref": "#/definitions/themePalette" },
        "dark": { "$ref": "#/definitions/themePalette" }
      },
      "additionalProperties": false
    },
    "themePalette": {
      "type": "object",
      "properties": {
        "rose": { "$ref": "#/definitions/colourPair" },
        "peach": { "$ref": "#/definitions/colourPair" },
        "lemon": { "$ref": "#/definitions/colourPair" },
        "mint": { "$ref": "#/definitions/colourPair" },
        "sky": { "$ref": "#/definitions/colourPair" },
        "lavender": { "$ref": "#/definitions/colourPair" }
      },
      "additionalProperties": false
    },
    "colourPair": {
      "type": "object",
      "properties": {
        "inactive": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" },
        "active": { "type": "string", "pattern": "^#[0-9a-fA-F]{6}$" }
      },
      "additionalProperties": false
    }
  }
}
