INNER CODE UNIT · Rust
from_lab
sharkdp/pastel · src/lib.rs:135
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 })
}
/// 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 {