colr-types 0.3.1

Color model ZSTs and marker traits for colr.
Documentation
//! CIE 1931 XYZ tristimulus model.

use core::marker::PhantomData;

use crate::BackingStore;
use crate::illuminant::{D65, Illuminant};

/// CIE XYZ tristimulus space normalized to Y = 1 under illuminant W.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct Xyz<W: Illuminant = D65>(PhantomData<W>);

impl<W: Illuminant> BackingStore<[f32; 3]> for Xyz<W> {}
impl<W: Illuminant> BackingStore<[f32; 4]> for Xyz<W> {}

#[cfg(feature = "glam")]
mod glam_impls {
    use super::*;
    impl<W: Illuminant> BackingStore<glam::Vec3A> for Xyz<W> {}
    impl<W: Illuminant> BackingStore<glam::Vec4> for Xyz<W> {}
}