palette-gamut-mapping

Crates.iopalette-gamut-mapping
lib.rspalette-gamut-mapping
version0.1.1
sourcesrc
created_at2024-05-22 10:02:06.711142
updated_at2024-06-04 09:19:08.259643
descriptionConvert colors between color spaces with CSS Color Module Level 4 gamut mapping
homepage
repositoryhttps://github.com/tomcur/palette-gamut-mapping
max_upload_size
id1247768
size25,066
Tom Churchman (tomcur)

documentation

README

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);
Commit count: 12

cargo fmt