palette-gamut-mapping 0.1.1

Convert colors between color spaces with CSS Color Module Level 4 gamut mapping
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 28.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 222.27 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • tomcur/palette-gamut-mapping
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tomcur

Gamut mapping

Map between color spaces

MIT Apache 2.0 Crates.io Docs

Convert Palette colors between color spaces with CSS Color Module Level 4's gamut mapping algorithm.

use palette::{Oklch, Srgb};
use palette_gamut_mapping::gamut_map;

let color = Oklch::new(0.5, 0.205, 230.);

// roughly equal to #006d91
let srgb: Srgb = gamut_map(color);