Eagle format extension for previewing Affinity .afpalette files, Adobe .ase swatch files, and palette-oriented .css token files.
When .afpalette, .ase, or .css files are imported into Eagle, this plugin:
- Generates a horizontal swatch-strip thumbnail for the library grid
- Opens a palette viewer when the item is opened
- Swatch palettes — reads palette name and ordered swatches from
Dloc_RGBA float blocks (e.g.sample.afpalette) - Gradient palettes — reads
PaLV/Cols/colDgradient chunks when present
Reads RGB, grayscale, and CMYK color blocks from flat ASE palettes. Group markers are ignored for display; swatches render in file order.
Reads NSColorList palettes archived with NSKeyedArchiver (RGB, grayscale, and CMYK entries). macOS-only format, but useful for previewing system and app-exported color lists in Eagle.
Parses --color-{family}-{shade} custom properties and groups preview by family (Red, Blue, etc.) with shade labels. Non-matching color variables appear under "Other Color Variables".
manifest.json— format extension manifest (previewforafpalette,ase,clr, andcss)thumbnail/palette.js— thumbnail generatorviewer/palette.html— palette viewer UIviewer/palette.js— viewer render helpersparsers/— shared afpalette/ase/clr/css parsing logiclib/swatch-png.js— pure-JS PNG swatch-strip writertest/— parser tests and fixtures
Symlink this repo into Eagle's plugin directory:
ln -sfn "/path/to/eagle-palette-viewer" "$HOME/Library/Application Support/Eagle/Plugins/palette-viewer"Restart Eagle after installing or updating the plugin.
On startup, the background service regenerates thumbnails and applies them to the library grid via setCustomThumbnail for existing .afpalette, .ase, and .clr files (no re-import needed). CSS palette files refresh when they are missing grid thumbnails.
If an item still shows a generic icon, open it once or restart Eagle after updating the plugin.
npm run generate-fixtures
npm testnpm run devServes static viewer assets at http://127.0.0.1:5174/. Full viewer parsing requires Eagle's Node-enabled viewer context (require('fs')); use Eagle for end-to-end preview verification.
test/fixtures/sample.afpalette— Affinity swatch palette (6 colors)test/fixtures/sample.ase— Adobe ASE palette (6 colors)test/fixtures/sample.clr— macOS color list (6 colors)test/fixtures/colors.css— trimmed CSS token sample
