A Visual Studio Code extension that provides interactive color previews, color pickers, and convenient palette tools for .pyxpal color palette files (used in Pyxel retro game engine and custom palette workflows).
Features
🎨 Inline Color Preview & Native Color Picker
Displays a color preview box next to each 6-digit HEX color code.
Click on the color box to open VS Code's native color picker and adjust colors visually in real time.
📋 One-Click CodeLens Copy
Index Number: Displays each line's zero-based palette index (0, 1, 2, ...) above the line. Click to copy the index number to your clipboard.
Constant Label: Displays the corresponding constant name (e.g., pyxel.COLOR_BLACK). Click to copy the constant identifier directly into your code.
🐍 Dynamic Python Constants Integration
If a .py file with the same name exists in the same directory (e.g., my_palette.py alongside my_palette.pyxpal), the extension automatically parses COLOR_<NAME>: int = <INDEX> declarations and displays the custom constant names as CodeLens labels.
If no custom Python file exists, default Pyxel palette constants (pyxel.COLOR_*) are used.
⚠️ Syntax Validation & Diagnostics
Automatically highlights invalid lines (empty characters, incorrect length, or non-HEX characters) with warnings to help prevent broken palette entries.
The .pyxpal Format
A .pyxpal file is a simple text file representing a color palette:
Each line contains a 6-digit HEX color code without the # prefix (case-insensitive).
COLOR_BACKGROUND: int = 0
COLOR_DARK_SLATE: int = 1
COLOR_RIVER_BLUE: int = 2
COLOR_EMERALD: int = 3
COLOR_SUN_YELLOW: int = 4
COLOR_CARROT: int = 5
COLOR_ALIZARIN: int = 6
COLOR_CLOUDS: int = 7
Usage
Open any file with the .pyxpal extension in VS Code.
Edit color values manually or click the inline color box to pick colors.
Click the CodeLens buttons above each line to copy color indices or constant names.