INNER CODE UNIT · Rust

from_rgb_float

sharkdp/pastel · src/lib.rs:103

    pub fn from_rgb_float(r: Scalar, g: Scalar, b: Scalar) -> Color {
        Self::from(&RGBA::<f64> {
            r,
            g,
            b,
            alpha: 1.0,
        })
    }

    /// 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>

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…