INNER CODE UNIT · Rust

from_rgb

sharkdp/pastel · src/lib.rs:86

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

    /// Create a `Color` from RGB and alpha values between 0.0 and 1.0. Values outside this range
    /// will be clamped.
    pub fn from_rgba_float(r: Scalar, g: Scalar, b: Scalar, alpha: Scalar) -> Color {
        Self::from(&RGBA::<f64> { r, g, b, alpha })
    }

    /// Create a `Color` from RGB values between 0.0 and 1.0. Values outside this range will be
    /// clamped.
    pub fn from_rgb_float(r: Scalar, g: Scalar, b: Scalar) -> Color {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…