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.
cd xscriptor-theme
python3 scripts/generate_themes.pyThis writes the generated files into scripts/output/ without
touching any files under src/main/resources/. The output directory
contains:
| Path | Description |
|---|---|
output/themes/*.theme.json | 12 UI theme files (Islands Dark / Islands Light) |
output/colors/*.xml | 12 editor color scheme files (Darcula / Default) |
output/plugin.xml | Reference extension entries for the real plugin.xml |
To write the generated files directly into src/main/resources/
(overwriting the real plugin files), use the --apply flag:
python3 scripts/generate_themes.py --applyAfter applying, rebuild the plugin:
./gradlew clean buildPlugin- The script parses
colors.mdat the repository root, extracting all 12 city-named palettes (X, Madrid, Lahabana, Miami, Paris, Tokio, Oslo, Helsinki, Berlin, London, Praha, Bogota). - Each palette defines 16 hex colors (
color0throughcolor15) in a standard terminal color scheme layout. - For each palette, the script derives secondary UI colors (backgrounds,
foregrounds, borders, selections) using blend functions, then generates:
- A
.theme.jsonfile with full Islands UI key overrides and an icon palette. - A
.xmleditor color scheme with multi-language syntax highlighting rules.
- A
- 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.
To add a new theme or change an existing one:
- Edit
colors.mdat the repository root. Add a new<h2>section with the theme name and its 16-color JSON palette, or modify an existing palette. - Add the theme name to the
DARK_THEMESorLIGHT_THEMESlist insidegenerate_themes.py. - Run the script again.
| Flag | Description |
|---|---|
--output PATH | Custom output directory (default: scripts/output/) |
--templates PATH | Custom directory for XML templates (default: scripts/templates/) |
--apply | Write directly to src/main/resources/ |
- Python 3.9 or later (standard library only, no external dependencies)