INNER CODE UNIT · Rust

from_oklab

sharkdp/pastel · src/lib.rs:143

    pub fn from_oklab(l: Scalar, a: Scalar, b: Scalar, alpha: Scalar) -> Color {
        Self::from(&OkLab { l, a, b, alpha })
    }

    /// Create a `Color` from lightness, chroma and hue coordinates in the CIE LCh color space.
    /// This is a cylindrical transform of 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_lch(l: Scalar, c: Scalar, h: Scalar, alpha: Scalar) -> Color {
        Self::from(&LCh { l, c, h, alpha })
    }

    /// Create a `Color` from lightness, chroma and hue coordinates in the OkLCh color space.
    /// This is a cylindrical transform of the OkLab color space. Note: See documentation for
    /// `from_xyz`. The same restrictions apply here.
    ///
    /// See: <https://bottosson.github.io/posts/oklab>

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…