Expand description
§Chromata
1000+ editor color themes as compile-time Rust constants.
Chromata provides every popular editor and terminal color theme as
compile-time const data. No file parsing, no runtime allocation,
one dependency (libm for no_std math). Add chromata to your Cargo.toml, write
chromata::popular::gruvbox::DARK_HARD.bg, and get a hex color
at zero cost.
§Feature Flags
| Feature | Themes | Description |
|---|---|---|
popular (default) | 49 | Curated best themes (gruvbox, catppuccin, nord…) |
base16 | 305 | Base16 themes from tinted-theming/schemes |
base24 | 184 | Base24 themes from tinted-theming/schemes |
vim | 464 | Vim colorschemes from vim-colorschemes repos |
emacs | 102 | Emacs themes from emacs-themes-site |
all | 1104 | All collections combined |
bevy-color-integration | — | From<Color> for bevy_color types |
colored-integration | — | From<Color> for colored types |
comfy-table-integration | — | From<Color> for comfy-table types |
crossterm-integration | — | From<Color> for crossterm types |
cursive-integration | — | From<Color> for cursive types |
egui-integration | — | From<Color> for egui types |
iced-integration | — | From<Color> for iced types |
image-integration | — | From<Color> for image types |
macroquad-integration | — | From<Color> for macroquad types |
owo-colors-integration | — | From<Color> for owo-colors types |
palette-integration | — | From<Color> for palette types |
plotters-integration | — | From<Color> for plotters types |
ratatui-integration | — | From<Color> for ratatui types |
slint-integration | — | From<Color> for slint types |
syntect-integration | — | From<Color> for syntect types |
termion-integration | — | From<Color> for termion types |
tiny-skia-integration | — | From<Color> for tiny-skia types |
wgpu-integration | — | From<Color> for wgpu types |
serde-support | — | Serialize + Deserialize for themes |
§Core Types
Color— RGB color with hex conversion, WCAG luminance, contrast ratio, lerpTheme— 29 color fields + metadata (name, author, variant, contrast)ThemeBuilder— Fluent builder for constructing themes at runtimeVariant—DarkorLightContrast—High,Normal, orLow(WCAG-based)Base16Palette— The 16 base16 palette slots (used withinBase24Palette)Base24Palette— Extended 24-slot palette (exported by base24 themes asPALETTE)
§Quick Start
use chromata::popular::gruvbox;
let theme = gruvbox::DARK_HARD;
println!("Background: {}", theme.bg.to_css_hex());
println!("Is dark? {}", theme.is_dark());§Query APIs
use chromata::{find_by_name, filter_by_variant, Variant};
if let Some(theme) = find_by_name("Gruvbox Dark Hard") {
println!("{}: {}", theme.name, theme.bg);
}
let dark_themes = filter_by_variant(Variant::Dark);Modules§
- base16
base16 - Base16 color themes.
- base24
base24 - Base24 color themes.
- emacs
emacs - Emacs color themes.
- popular
popular - Curated collection of the most popular editor themes.
- prelude
- Convenience re-exports for common chromata types.
- vim
vim - Vim color themes.
Structs§
- Base16
Palette - The 16 base16 palette slots.
- Base24
Palette - Extended base24 theme with additional accent slots.
- Color
- A color represented as RGB components. All values are compile-time constants with zero runtime cost.
- Parse
Color Error - Error returned when parsing a
Colorfrom a string fails. - Parse
Contrast Error - Error returned when parsing a
Contrastfrom a string fails. - Parse
Variant Error - Error returned when parsing a
Variantfrom a string fails. - Theme
- A complete editor/terminal color theme.
- Theme
Builder - Builder for constructing
Themevalues at runtime.
Enums§
- Contrast
- Contrast level classification based on WCAG contrast ratio.
- Variant
- Dark or light theme variant.
Functions§
- collect_
all_ themes - Collect all themes from enabled feature modules into a Vec.
- filter_
by_ contrast - Filter all themes by contrast level.
- filter_
by_ variant - Filter all themes by variant (Dark or Light).
- find_
by_ name - Find a theme by exact name (case-sensitive).