coloremetry 0.2.0

small color library written in Rust
Documentation
/*
 *    Copyright 2025 Jared Davis
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
use crate::cie::xyz::XYZ;

// D65 "Daylight" Illumination transform values from Bruce Lindbloom
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
pub const D65: Illumination = crate::illumination!(
    [
        [0.4124564, 0.3575761, 0.1804375],
        [0.2126729, 0.7151522, 0.0721750],
        [0.0193339, 0.1191920, 0.9503041]
    ],
    [
        [3.2404542, -1.5371385, -0.4985314],
        [-0.9692660, 1.8760108, 0.0415560],
        [0.0556434, -0.2040259, 1.0572252]
    ],
    [1.05211106084, 1.0, 0.9184170164]
);

#[derive(Clone, Copy)]
pub struct Illumination {
    pub(crate) x: [f32; 3],
    pub(crate) y: [f32; 3],
    pub(crate) z: [f32; 3],

    pub(crate) r: [f32; 3],
    pub(crate) g: [f32; 3],
    pub(crate) b: [f32; 3],

    pub(crate) reference: XYZ,
}