Function zng_color::hsla

source ·
pub fn hsla<H: Into<AngleDegree>, N: Into<Factor>, A: Into<Factor>>(
    hue: H,
    saturation: N,
    lightness: N,
    alpha: A,
) -> Hsla
Expand description

HSLA color.

§Arguments

The first argument hue can be any angle unit. The other two arguments can be f32 in the 0.0..=1.0 range or a percentage.

The saturation and lightness arguments must be of the same type.

§Examples

use zng_color::hsla;
use zng_layout::unit::*;

let red = hsla(0.deg(), 100.pct(), 50.pct(), 1.0);
let green = hsla(115.deg(), 1.0, 0.5, 100.pct());
let transparent = hsla(0.deg(), 1.0, 0.5, 0.0);