ggsci 0.1.0

Scientific and sci-fi color palettes from ggsci for Rust
Documentation
  • Coverage
  • 100%
    29 out of 29 items documented0 out of 5 items with examples
  • Size
  • Source code size: 57.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 894.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • nanxstats/ggsci-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nanxstats

ggsci

Scientific and sci-fi color palettes from the R package ggsci, packaged as static Rust data.

This first release includes static non-Gephi, non-iTerm palettes generated from upstream. Continuous seed palettes such as gsea, bs5, material, and tw3 are exposed as static color arrays only; interpolation is future work.

let palette = ggsci::palette("npg", "nrc")?;
let colors = palette.take_hex(3)?;

assert_eq!(colors, ["#E64B35", "#4DBBD5", "#00A087"]);
# Ok::<(), ggsci::Error>(())

Lookup is case-insensitive and accepts _, -, and spaces interchangeably:

let palette = ggsci::palette_by_spec("material:blue-grey")?;
assert_eq!(palette.family(), "material");
assert_eq!(palette.variant(), "blue-grey");
# Ok::<(), ggsci::Error>(())

The crate has no runtime dependencies, no feature flags, and no build script.