Need a color palette? Do you have to hand-roll it?
Palette Core is a theme engine that turns TOML palette definitions into CSS, terminal, egui, JSON, and WASM exports.
use preset;
let palette = preset.expect;
let css = palette.to_css;
}
Install
cargo add palette-core
Usage
Terminal
use preset;
use to_terminal_theme;
let palette = preset.expect;
let theme = to_terminal_theme;
Theme variants
Variants inherit from a base and override only what changes.
[]
= "My Dark Warm"
= "my_dark_warm"
= "tokyonight"
[]
= "#24283b"
Contrast validation and auto-fix
use ;
use validate_palette;
let palette = preset.expect;
let violations = validate_palette;
// Auto-fix: nudge failing foregrounds to meet WCAG at resolve time
let resolved = palette.resolve_with_contrast;
Documentation
The guide covers rendering targets, theme switching, custom presets, color manipulation, platform overrides, and WASM bindings.
31 presets ship built-in — Catppuccin, TokyoNight, Dracula, Nord, Gruvbox, and more. Golden Hour is an original warm-toned family (light, dusk, twilight) exclusive to palette-core. Optional feature flags enable terminal, egui, snapshot, platform, and wasm targets.
License
Licensed under Apache-2.0 or MIT at your option.