INNER CODE UNIT · Rust

from_lms

sharkdp/pastel · src/lib.rs:127

    pub fn from_lms(l: Scalar, m: Scalar, s: Scalar, alpha: Scalar) -> Color {
        Self::from(&LMS { l, m, s, alpha })
    }

    /// Create a `Color` from L, a and b coordinates coordinates in the Lab color
    /// space. Note: See documentation for `from_xyz`. The same restrictions apply here.
    ///
    /// See: <https://en.wikipedia.org/wiki/Lab_color_space>
    pub fn from_lab(l: Scalar, a: Scalar, b: Scalar, alpha: Scalar) -> Color {
        Self::from(&Lab { l, a, b, alpha })
    }

    /// Create a `Color` from L, a and b coordinates coordinates in the OkLab color
    /// space. Note: See documentation for `from_xyz`. The same restrictions apply here.
    ///
    /// See: <https://bottosson.github.io/posts/oklab>
    pub fn from_oklab(l: Scalar, a: Scalar, b: Scalar, alpha: Scalar) -> Color {
        Self::from(&OkLab { l, a, b, alpha })

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…