Expand description
§Prismatica – Scientific Colormaps for Rust
260+ perceptually uniform, colorblind-safe colormaps from: matplotlib, Crameri, CET, CMOcean, ColorBrewer, CMasher, NCAR, and more.
use prismatica::crameri::BATLOW;
let color = BATLOW.eval(0.5);
println!("RGB: ({}, {}, {})", color.r, color.g, color.b);§Feature Flags
| Feature | Colormaps | Description |
|---|---|---|
core (default) | ~48 | matplotlib + Crameri |
cet | +60 | Peter Kovesi’s perceptually uniform maps |
cmocean | +22 | Oceanographic colormaps |
colorbrewer | +35 | Cynthia Brewer’s cartographic palettes |
cmasher | +30 | Astrophysics colormaps |
ncar | +40 | NCAR NCL geoscience maps |
cartocolors | +15 | CARTO cartographic maps |
moreland | +6 | Cool-warm, black body, Kindlmann |
d3 | varies | d3-scale-chromatic maps |
all | ~260+ | Everything |
§Choosing a Colormap
- Sequential data (temperature, elevation, concentration):
batlow,viridis,oslo,thermal - Diverging data (anomalies, residuals):
berlin,vik,balance,cool_warm - Cyclic data (phase, direction, time-of-day):
romaO,phase,twilight - Categorical data (labels, classes):
ColorBrewer qualitative palettes:
SET2,DARK2,PAIRED
Modules§
- crameri
- Crameri Scientific Colour Maps (batlow, berlin, roma, oslo, tokyo, hawaii, and 30+ more).
- matplotlib
- Matplotlib colormaps (viridis, inferno, magma, plasma, cividis, twilight, mako, rocket).
Structs§
- Color
- An sRGB color with 8-bit channels.
- Colormap
- A continuous colormap backed by a precomputed lookup table.
- Colormap
Meta - Metadata about a colormap’s scientific properties.
- Discrete
Palette - A discrete palette of distinct colors for categorical data.
- Reversed
Colormap - A reversed view of a colormap. Zero allocation.
Enums§
- Colormap
Kind - The type/class of a colormap, following standard scientific nomenclature.
Traits§
- Into
Framework Color - Trait for converting a prismatica
Colorto a framework-specific color type.
Functions§
- all_
colormaps - Returns all colormaps enabled by the current feature flags.
- filter_
by_ collection - Return all colormaps from a given collection.
- filter_
by_ kind - Return all colormaps of a given kind.
- find_
by_ name - Look up a colormap by its canonical name (case-sensitive).