Rust implementation of Heer and Stone's C3 library.
Loading data
C3::new/C3::try_new— Loads the same bundledc3_color.npy,c3_a.npy, andc3_t.npyviainclude_bytes!at compile time. Works on native andwasm32-unknown-unknown(browser): no runtime filesystem.C3::from_embedded_npy— Same bytes, explicitResultAPI.C3::from_npy_dir— Read.npyfrom disk (not available onwasm32-unknown-unknown; use WASI or embedded loaders instead).
The crates.io package ships those .npy files under src/ for reproducibility; dependents normally just call C3::try_new()?. without copying JSON or duplicating arrays.
Slice-oriented APIs
For JS interop or tight loops without ndarray::Array2:
analyze_lab_rowscolor_indices_lab_rowspalette_terms_lab_rowsanalyze_lab_rows_with_distance_matrix
Tests
cargo test
Optional regression run against on-disk .npy (must match the embedded bundle):
cargo test --test c3 -- --ignored
Benchmarks
cargo bench
Criterion writes reports under target/criterion/.
WASM CI
GitHub Actions runs cargo check --lib --target wasm32-unknown-unknown so browser builds stay compiling.