Palettegen
A complete UI color palette from one color
Palettegen serves Palette Forge — pick one color and get the full system a real interface needs: ten shades each of a primary scale, temperature-matched neutrals, and supporting scales, or any of the 24 curated palettes from Refactoring UI: Color Palettes (Wathan & Schoger), whose methodology drives the generator. The output is a PDF laid out like the book’s palette pages and JSON ready for a theme file — downloadable or copy-pasteable.
The page itself is the best demo: the app’s entire chrome — background, text, buttons, focus rings, shadows — is derived from the palette it is showing, in light and dark alike, so every generated palette is test-driven by the very page presenting it. Six in-context tiles (cards on light and dark grounds, semantic alerts, text hierarchy, navigation, forms) show the colors doing their actual jobs.
Features
- Generation after the book’s recipe: your color anchors into the nearest of 30 hand-tuned reference scales; hue rotates uniformly while saturation and lightness corrections fade toward the ends, preserving usable-as-text darks and tinted-background lights
- Neutrals matched to the primary’s temperature; semantic red/yellow/green scales (vivid or muted to match) plus a complementary accent
- PDF export in the book’s page style; pretty JSON with the book’s category notes; a copyable JSON block on the page
- Light/dark follows the OS or an explicit choice — with zero JavaScript: all state, the color scheme included, lives in the URL
- One static binary: embedded palette data and fonts (Overpass, Atkinson Hyperlegible), no assets, no database
Run
Try it in the browser — the exact same goml program, compiled to WebAssembly and rendering the same pages client-side (PDF and JSON exports included). Or run the real server:
go install goforge.dev/palettegen@latest
palettegen # serves on http://localhost:8383 (PORT overrides)
palettegen check # the goml-native self-check suite
Pure goml
Every line of application code is goml — the ML-family surface
for the Go+ toolchain — compiled to committed, ordinary Go (goml gen -check keeps CI honest). The book’s data and the fonts are embedded as
generated goml sources; even the test suite is goml. There are no
hand-written .go or .gp files in the repository.