prismatica 0.2.0

308 scientific colormaps as compile-time Rust constants
Documentation
//! # Prismatica -- Scientific Colormaps for Rust
//!
//! 308 scientific colormaps + 70 discrete palettes from 10 collections:
//! matplotlib, Crameri, CET, CMOcean, ColorBrewer, CMasher, NCAR, CartoColors, Moreland, and d3.
//!
//! ```
//! 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 (8) + Crameri (40) |
//! | `cet` | +59 | Peter Kovesi's perceptually uniform maps |
//! | `cmocean` | +22 | Oceanographic colormaps |
//! | `colorbrewer` | +35 (+35 palettes) | Cynthia Brewer's cartographic palettes |
//! | `cmasher` | +53 | Astrophysics colormaps |
//! | `ncar` | +44 | NCAR NCL geoscience maps |
//! | `cartocolors` | +34 (+34 palettes) | CARTO cartographic maps |
//! | `moreland` | +6 | Cool-warm, black body, Kindlmann |
//! | `d3` | +7 (+1 palette) | Turbo, Rainbow, Sinebow, Cubehelix, Tableau10 |
//! | `all` | 308 (+70 palettes) | Everything |
//!
//! ## Choosing a Colormap
//!
//! - **Sequential data** (temperature, elevation, concentration):
//!   `batlow`, `viridis`, `oslo`, `thermal`
//! - **Diverging data** (anomalies, residuals):
//!   `berlin`, `vik`, `balance`, `smooth-cool-warm`
//! - **Cyclic data** (phase, direction, time-of-day):
//!   `romaO`, `phase`, `twilight`
//! - **Categorical data** (labels, classes):
//!   `SET2`, `DARK2`, `PAIRED`, `Tableau10`
//!
//! ## Minimum Supported Rust Version
//!
//! Prismatica requires Rust **1.85** or later (edition 2024).

#![no_std]
#![forbid(unsafe_code)]
#![deny(clippy::unwrap_used)]

#[cfg(feature = "alloc")]
extern crate alloc;

mod types;
pub use types::*;

mod traits;
pub use traits::*;

pub mod prelude;
mod registry;

#[cfg(any(
    feature = "egui-integration",
    feature = "plotters-integration",
    feature = "image-integration",
    feature = "serde-support",
))]
mod integration;
pub use registry::*;

// -- Collection modules (feature-gated) --

#[cfg(feature = "matplotlib")]
pub mod matplotlib;

#[cfg(feature = "crameri")]
pub mod crameri;

#[cfg(feature = "cet")]
pub mod cet;

#[cfg(feature = "cmocean")]
pub mod cmocean;

#[cfg(feature = "colorbrewer")]
pub mod colorbrewer;

#[cfg(feature = "cmasher")]
pub mod cmasher;

#[cfg(feature = "ncar")]
pub mod ncar;

#[cfg(feature = "cartocolors")]
pub mod cartocolors;

#[cfg(feature = "moreland")]
pub mod moreland;

#[cfg(feature = "d3")]
pub mod d3;