scala-chromatica
A framework-agnostic Rust library for color gradients with smooth interpolation.
Features
- 🎨 Smooth RGB interpolation between color stops
- 🌈 HSV color space support for vibrant gradients
- 💾 JSON serialization for persistent storage
- 📦 15 built-in color schemes embedded at compile time
- 📁 Platform-specific config directories for custom colormaps
- 🚫 No GUI framework dependencies - use with any rendering system
Installation
Add to your Cargo.toml:
[]
= "0.1.1"
Quick Example
use ;
// Load a built-in colormap
let fire = load_builtin_colormap?;
let color = fire.get_color;
println!;
// Create a custom gradient
let mut custom = new;
custom.add_stop;
custom.add_stop;
// Save for later
save_colormap?;
Built-in Colormaps
Basic: Default, Fire, Ocean, Grayscale, Rainbow
Extended: Academic, Twilight Garden, Coral Sunset, Olive Symmetry, Orchid Garden, Frozen Amaranth, Electric Neon, Cosmic Dawn, Vintage Lavender
Use Cases
- 📊 Data visualization and scientific plotting
- 🖼️ Fractal rendering (Mandelbrot, Julia sets)
- 🎮 Game development (heatmaps, effects)
- 🗺️ Geographic data visualization
- 📈 Any application requiring smooth color transitions
Documentation
Full API documentation is available on docs.rs.
License
Dually licensed under MIT OR Apache-2.0 at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Origin
Extracted from forma-fractalis, a high-performance fractal renderer, to enable reuse across other visualization projects.