Function smart_leds::hsv::hsv2rgb

source ·
pub fn hsv2rgb(hsv: Hsv) -> RGB8
Expand description

Converts a hsv value into RGB values. Because the hsv values are integers, the precision of the resulting RGB value is limited to ±4.

NOTE: Since most led protocols & their implementations are very timing sensitive, it’s advisable to do the conversion before write-ing.

Example

use smart_leds::hsv::{hsv2rgb, Hsv};
let hsv = Hsv{hue: 89, sat: 230, val: 42};
let conv_rgb = hsv2rgb(hsv);
// will return RGB { r: 4, g: 41, b: 8},