pub fn from_xyz(x: Scalar, y: Scalar, z: Scalar, alpha: Scalar) -> Color {
        #![allow(clippy::many_single_char_names)]
        let f = |c| {
            if c <= 0.003_130_8 {
                12.92 * c
            } else {
                1.055 * Scalar::powf(c, 1.0 / 2.4) - 0.055
            }
        };

        let r = f(3.2406 * x - 1.5372 * y - 0.4986 * z);
        let g = f(-0.9689 * x + 1.8758 * y + 0.0415 * z);
        let b = f(0.0557 * x - 0.2040 * y + 1.0570 * z);

        Self::from_rgba_float(r, g, b, alpha)
    }
/// Create a `Color` from XYZ coordinates in the CIE 1931 color space. Note that a `Color`
/// always represents a color in the sRGB gamut (colors that can be represented on a typical
/// computer screen) while the XYZ color space is bigger. This function will tend to create
/// fully saturated colors at the edge of the sRGB gamut if the coordinates lie outside the
/// sRGB range.
///
/// See:
/// - https://en.wikipedia.org/wiki/CIE_1931_color_space
/// - https://en.wikipedia.org/wiki/SRGB
Create a `Color` from XYZ coordinates in the CIE 1931 color space. Note that a `Color`
always represents a color in the sRGB gamut (colors that can be represented on a typical
computer screen) while the XYZ color space is bigger. This function will tend to create
fully saturated colors at the edge of the sRGB gamut if the coordinates lie outside the
sRGB range.


Create a ` Color ` from XYZ coordinates in the CIE 1931 color space . Note that a ` Color ` always represents a color in the sRGB gamut ( colors that can be represented on a typical computer screen ) while the XYZ color space is bigger . This function will tend to create fully saturated colors at the edge of the sRGB gamut if the coordinates lie outside the sRGB range .
pub fn from_xyz(x: Scalar, y: Scalar, z: Scalar, alpha: Scalar) -> Color {
        #![allow(clippy::many_single_char_names)]
        let f = |c| {
            if c <= 0.003_130_8 {
                12.92 * c
            } else {
                1.055 * Scalar::powf(c, 1.0 / 2.4) - 0.055
            }
        };
        let r = f(3.2406 * x - 1.5372 * y - 0.4986 * z);
        let g = f(-0.9689 * x + 1.8758 * y + 0.0415 * z);
        let b = f(0.0557 * x - 0.2040 * y + 1.0570 * z);
        Self::from_rgba_float(r, g, b, alpha)
    }
pub fn from_xyz ( x : Scalar , y : Scalar , z : Scalar , alpha : Scalar ) -> Color { # ! [ allow ( clippy many_single_char_names ) ] let f = | c | { if c <= 0.003_130_8 { 12.92 * c } else { 1.055 * Scalar :: powf ( c , 1.0 / 2.4 ) - 0.055 } } ; let r = f ( 3.2406 * x - 1.5372 * y - 0.4986 * z ) ; let g = f ( - 0.9689 * x + 1.8758 * y + 0.0415 * z ) ; let b = f ( 0.0557 * x - 0.2040 * y + 1.0570 * z ) ; Self :: from_rgba_float ( r , g , b , alpha ) }
Create a `Color` from XYZ coordinates in the CIE 1931 color space.
Create a ` Color ` from XYZ coordinates in the CIE 1931 color space .
x
Scalar
y
Scalar
z
Scalar
alpha
Scalar
x
Scalar
y
Scalar
z
Scalar
alpha
Scalar