Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Theme Generator Script

The generate_themes.py script reads the color palettes defined in colors.md at the repository root and produces all 12 theme files (UI themes and editor color schemes) for the Xscriptor JetBrains plugin.

Quick Start

cd xscriptor-theme
python3 scripts/generate_themes.py

This writes the generated files into scripts/output/ without touching any files under src/main/resources/. The output directory contains:

PathDescription
output/themes/*.theme.json12 UI theme files (Islands Dark / Islands Light)
output/colors/*.xml12 editor color scheme files (Darcula / Default)
output/plugin.xmlReference extension entries for the real plugin.xml

Applying to the Plugin

To write the generated files directly into src/main/resources/ (overwriting the real plugin files), use the --apply flag:

python3 scripts/generate_themes.py --apply

After applying, rebuild the plugin:

./gradlew clean buildPlugin

How It Works

  1. The script parses colors.md at the repository root, extracting all 12 city-named palettes (X, Madrid, Lahabana, Miami, Paris, Tokio, Oslo, Helsinki, Berlin, London, Praha, Bogota).
  2. Each palette defines 16 hex colors (color0 through color15) in a standard terminal color scheme layout.
  3. For each palette, the script derives secondary UI colors (backgrounds, foregrounds, borders, selections) using blend functions, then generates:
    • A .theme.json file with full Islands UI key overrides and an icon palette.
    • A .xml editor color scheme with multi-language syntax highlighting rules.
  4. The XML templates in scripts/templates/ provide the structure for editor color schemes; the script performs hex color substitution to adapt them to each palette.

Adding or Modifying a Theme

To add a new theme or change an existing one:

  1. Edit colors.md at the repository root. Add a new <h2> section with the theme name and its 16-color JSON palette, or modify an existing palette.
  2. Add the theme name to the DARK_THEMES or LIGHT_THEMES list inside generate_themes.py.
  3. Run the script again.

Command-Line Options

FlagDescription
--output PATHCustom output directory (default: scripts/output/)
--templates PATHCustom directory for XML templates (default: scripts/templates/)
--applyWrite directly to src/main/resources/

Requirements

  • Python 3.9 or later (standard library only, no external dependencies)