A Python script to generate a Visual Studio Code color theme from a standard ANSI terminal color theme.
An example of a generated theme can be found in the Itten Color Theme for VS Code.
The script requires Python 3.11 or above. The project is managed with Poetry but, as it does not have any external dependencies, this only provides a convenient method to execute the script. The script, theme_generate.py which can be found in the src directory, can also be run directly using Python and does not require Poetry.
- Clone the repository using Git
git clone https://github.com/grabpot/vscode-theme-generator.git vscode-theme-generator
- Install and run the script using Poetry and the output file, with the suffix
-color-theme.json, will be written to the current working directory:
poetry install
poetry run theme-generate
- Alternatively, you can provide a custom
colors.tomlusing the optional--colorsargument (the default file can be found in thesrcdirectory), and/or a custom themetheme.tomlfile using--theme, for example:
poetry run theme-generate --colors colors.toml
- After tweaking your color theme, follow these instructions to generate your theme extension: Create a new Color Theme
For further information on Visual Studio color themes, see the documenation on Color Themes, and for details on workbench colors see Theme Color.
This work is licensed under the GNU General Public License, Version 3.