Module nannou::color::chromatic_adaptation[][src]

Convert colors from one reference white point to another

Chromatic adaptation is the human visual system’s ability to adjust to changes in illumination in order to preserve the appearance of object colors. It is responsible for the stable appearance of object colours despite the wide variation of light which might be reflected from an object and observed by our eyes.

This library provides three methods for chromatic adaptation Bradford (which is the default), VonKries and XyzScaling

use palette::Xyz;
use palette::white_point::{A, C};
use palette::chromatic_adaptation::AdaptInto;

let a = Xyz::<A, f32>::with_wp(0.315756, 0.162732, 0.015905);

//Will convert Xyz<A, f32> to Xyz<C, f32> using Bradford chromatic adaptation
let c: Xyz<C, f32> = a.adapt_into();

//Should print {x: 0.257963, y: 0.139776,z: 0.058825}
println!("{:?}", c)



Holds the matrix coeffecients for the chromatic adaptation methods



Chromatic adaptation methods implemented in the library



Trait to convert color from one reference white point to another


Trait to convert color with one reference white point into another


Generates a conversion matrix to convert the Xyz trisitmilus values from one illuminant to another (Swp -> Dwp)