10 releases
Uses new Rust 2024
| 0.3.6 | Jan 23, 2026 |
|---|---|
| 0.3.5 | Jan 23, 2026 |
| 0.3.4 | Dec 25, 2025 |
| 0.1.2 | Dec 24, 2025 |
#646 in Hardware support
Used in spectro-gui
270KB
5K
SLoC
🌈 spectro-rs
A high-performance Rust driver for X-Rite ColorMunki spectrometers. This library provides a safe, cross-platform interface for color measurement, display calibration, and spectral analysis.
✨ Features
- Cross-platform: Windows, macOS, and Linux support
- Multi-mode Measurement: Reflective, Emissive (Monitor), and Ambient modes
- Colorimetry Engine: CIE XYZ, L*a*b*, CCT, and Delta E (76/2000) calculations
- Calibration Persistence: Automatically saves and loads calibration data
- Internationalization: Built-in English and Chinese support
📦 Installation
Add to your Cargo.toml:
[dependencies]
spectro-rs = "0.3"
🚀 Quick Start
use spectro_rs::{discover, MeasurementMode};
fn main() -> spectro_rs::Result<()> {
// Auto-discover connected spectrometer
let mut device = discover()?;
// Print device info
let info = device.info()?;
println!("Found: {} ({})", info.model, info.serial);
// Calibrate (required for reflective mode)
device.calibrate()?;
// Take a measurement
let spectrum = device.measure(MeasurementMode::Reflective)?;
// Convert to colorimetric values
let xyz = spectrum.to_xyz();
let lab = xyz.to_lab(spectro_rs::colorimetry::illuminant::D65_2);
println!("L*={:.2}, a*={:.2}, b*={:.2}", lab.l, lab.a, lab.b);
Ok(())
}
📖 Documentation
Full API documentation is available on docs.rs.
⚠️ Driver Setup
- Windows: Use Zadig to install the WinUSB driver.
- Linux: Add appropriate udev rules for USB access.
🔗 Related
- spectro-gui: Graphical interface for this library
⚖️ License
Licensed under the GNU General Public License v3.0.
Dependencies
~11–22MB
~261K SLoC