{
    "version": "0.4",
    "definitions": {
        "color": {
            "type": "string",
            "pattern": "^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$",
            "title": "Color",
            "description": "Color in #RRGGBB or #RRGGBBAA format",
            "examples": [
                "#123abc",
                "#123abc80"
            ]
        },
        "background": {
            "type": "object",
            "required": [
                "image"
            ],
            "title": "Background image",
            "description": "Background image for entire window",
            "properties": {
                "image": {
                    "type": "string",
                    "title": "Path to the background image",
                    "description": "Path to the background image starting with '/'",
                    "default": "",
                    "examples": [
                        "/background.jpg"
                    ]
                },
                "transparency": {
                    "type": "integer",
                    "title": "Transparency for background image.",
                    "description": "An integer from 0 to 100.",
                    "default": 10,
                    "minimum": 0,
                    "maximum": 100,
                    "examples": [
                        10
                    ]
                },
                "fill": {
                    "type": "string",
                    "title": "Background image filling options",
                    "default": "scale",
                    "description": "Background image filling options. One of the following values: plain, scale, tile",
                    "enum": [
                        "plain",
                        "scale",
                        "tile"
                    ],
                    "examples": [
                        "scale"
                    ]
                },
                "anchor": {
                    "type": "string",
                    "title": "Background image anchor",
                    "default": "center",
                    "description": "Background image anchor. One of the following values: top_left, top_center, top_right, middle_left, center, middle_right, bottom_left, bottom_center, bottom_right",
                    "enum": [
                        "top_left",
                        "top_center",
                        "top_right",
                        "middle_left",
                        "center",
                        "middle_right",
                        "bottom_left",
                        "bottom_center",
                        "bottom_right"
                    ],
                    "examples": [
                        "center"
                    ]
                }
            }
        },
        "ColorPaletteBase": {
            "type": "object",
            "properties": {
                "Actions.Red": {
                    "$ref": "#/definitions/color",
                    "description": "Action colors are for icons that appear on toolbars"
                },
                "Actions.Yellow": {
                    "$ref": "#/definitions/color"
                },
                "Actions.Green": {
                    "$ref": "#/definitions/color"
                },
                "Actions.Blue": {
                    "$ref": "#/definitions/color"
                },
                "Actions.Grey": {
                    "$ref": "#/definitions/color"
                },
                "Actions.GreyInline": {
                    "$ref": "#/definitions/color",
                    "description": "Light-gray icons at the right side in input fields and combo boxes"
                },
                "Actions.GreyInline.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Objects.Grey": {
                    "$ref": "#/definitions/color",
                    "description": "Object colors are for icons in lists and trees"
                },
                "Objects.Blue": {
                    "$ref": "#/definitions/color"
                },
                "Objects.Green": {
                    "$ref": "#/definitions/color"
                },
                "Objects.Yellow": {
                    "$ref": "#/definitions/color"
                },
                "Objects.YellowDark": {
                    "$ref": "#/definitions/color"
                },
                "Objects.Purple": {
                    "$ref": "#/definitions/color"
                },
                "Objects.Pink": {
                    "$ref": "#/definitions/color"
                },
                "Objects.Red": {
                    "$ref": "#/definitions/color"
                },
                "Objects.RedStatus": {
                    "$ref": "#/definitions/color"
                },
                "Objects.GreenAndroid": {
                    "$ref": "#/definitions/color"
                },
                "Objects.BlackText": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Background.Default": {
                    "$ref": "#/definitions/color",
                    "description": "An unchecked checkbox or radio button"
                },
                "Checkbox.Border.Default": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Background.Selected": {
                    "$ref": "#/definitions/color",
                    "description": "A checked checkbox or radio button"
                },
                "Checkbox.Border.Selected": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Foreground.Selected": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Background.Disabled": {
                    "$ref": "#/definitions/color",
                    "description": "A disabled checkbox or radio button"
                },
                "Checkbox.Border.Disabled": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Foreground.Disabled": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Focus.Thin.Default": {
                    "$ref": "#/definitions/color",
                    "description": "1px inner border in the focused state"
                },
                "Checkbox.Focus.Thin.Selected": {
                    "$ref": "#/definitions/color"
                },
                "Checkbox.Focus.Wide": {
                    "$ref": "#/definitions/color",
                    "description": "2px outer border in the focused state"
                },
                "Checkbox.Background.Default.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Border.Default.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Background.Selected.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Border.Selected.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Foreground.Selected.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Background.Disabled.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Border.Disabled.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Foreground.Disabled.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Focus.Thin.Default.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Focus.Thin.Selected.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Checkbox.Focus.Wide.Dark": {
                    "$ref": "#/definitions/color",
                    "description": "Use for dark themes"
                },
                "Tree.iconColor": {
                    "$ref": "#/definitions/color",
                    "description": "Color of expand/collapse icons"
                }
            }
        },
        "ColorPalette": {
            "anyOf": [
                {
                    "$ref": "#/definitions/ColorPaletteBase"
                }
            ],
            "properties": {
                "Protanopia": {
                    "$ref": "#/definitions/ColorPaletteBase",
                    "description": "Color palette for protanopia vision deficiency"
                },
                "Deuteranopia": {
                    "$ref": "#/definitions/ColorPaletteBase",
                    "description": "Color palette for deuteranopia vision deficiency"
                }
            }
        }
    },
    "type": "object",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "required": [
        "name",
        "dark",
        "author",
        "ui"
    ],
    "properties": {
        "name": {
            "type": "string",
            "title": "Theme name",
            "description": "Theme name",
            "default": "",
            "examples": [
                "My Brand New Theme"
            ]
        },
        "dark": {
            "type": "boolean",
            "title": "Dark theme",
            "description": "If 'true' then Darcula theme will be used as the base for modification, otherwise Light theme will be used.",
            "default": false,
            "examples": [
                true
            ]
        },
        "author": {
            "type": "string",
            "title": "Theme author",
            "description": "The author of the theme",
            "default": "",
            "examples": [
                "John Doe"
            ]
        },
        "editorScheme": {
            "type": "string",
            "title": "Path to the editor schema xml file starting with '/'",
            "default": "",
            "pattern": "^/",
            "examples": [
                "/editorScheme.xml"
            ]
        },
        "ui": {
            "type": "object"
        },
        "background": {
            "$ref": "#/definitions/background"
        },
        "emptyFrameBackground": {
            "$ref": "#/definitions/background"
        },
        "icons": {
            "type": "object",
            "patternProperties": {
                "^/": {
                    "type": "string",
                    "pattern": "^/"
                },
                "^[^/]": {
                    "type": "object",
                    "patternProperties": {
                        "^/": {
                            "type": "string",
                            "pattern": "^/"
                        }
                    }
                }
            },
            "properties": {
                "ColorPalette": {
                    "$ref": "#/definitions/ColorPalette"
                }
            }
        },
        "colors": {
            "type": "object",
            "title": "Theme Color Palette",
            "description": "Define common colors here and use color names in 'ui' section instead of #rrggbb values",
            "patternProperties": {
                ".*": {
                    "$ref": "#/definitions/color"
                }
            }
        }
    }
}