Function zng_color::hsv

source ·
pub fn hsv<H: Into<AngleDegree>, N: Into<Factor>>(
    hue: H,
    saturation: N,
    value: N
) -> Hsva
Expand description

HSV color, opaque, alpha is set to 1.0.

§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 value arguments must be of the same type.

§Examples

use zng_color::hsv;
use zng_layout::unit::*;

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