Generates OpenCode built-in theme JSON files from the Xscriptor color palette collection.
- Python 3.7 or later
Uses the 12 pre-defined themes compiled into the script:
./generate.py
./generate.py --output ../distReads ANSI color definitions from colors.md and converts them to the full OpenCode semantic theme format with auto-generated dark/light variants:
./generate.py --colors ../../colors.md
./generate.py --colors ../../colors.md --output ../distAll generated theme JSON files are written to the specified output directory (default: dist/). Each file follows the https://opencode.ai/theme.json schema with:
defs- Color definitions withdarkandlightprefixed referencestheme- Semantic color mappings with{ "dark": "...", "light": "..." }variant objects
| Theme | Type | Description |
|---|---|---|
| x | Dark | Deep dark with vibrant pink, green, and cyan accents |
| madrid | Light | Clean light with deep red, green, and blue tones |
| lahabana | Dark | Dark gray with bright neon accents |
| miami | Dark | True black with synthwave-inspired colors |
| paris | Dark | Purple-black with pastel cyan and blue |
| tokio | Dark | Dark gray with balanced warm and cool tones |
| oslo | Dark | Blue-gray with professional muted palette |
| helsinki | Light | Near-white with earthy, natural tones |
| berlin | Dark | Black with monochrome grayscale palette |
| london | Light | White with sophisticated grayscale tones |
| praha | Dark | Dark with Dracula-inspired vibrant colors |
| bogota | Dark | Maroon-black with cyan and warm accents |
- Standalone mode: Uses theme data built into the script with pre-designed dark/light variants for each scheme.
- colors.md mode: Parses the markdown file, extracts ANSI color tables (color0-color15), and auto-generates full OpenCode themes. Light variants are derived by swapping background/foreground and blending accent colors.
- Each theme is written as a separate JSON file in the output directory.
The generated files are ready for submission as built-in themes in the OpenCode repository. Copy them to:
packages/opencode/src/cli/cmd/tui/context/theme/Then register each theme in theme.tsx by adding an import and an entry in the DEFAULT_THEMES object.