color

Macro color 

Source
macro_rules! color {
    (c=$color:expr, alpha=$alpha:expr, $($child:expr);+;) => { ... };
    (c=$color:expr, $($child:expr);+;) => { ... };
    ([$r:expr, $g:expr, $b:expr, $a:expr], $($child:expr);+;) => { ... };
    ($hex:expr, $($child:expr);+;) => { ... };
}
Expand description

Colors children.

#params

[r, g, b, a]: 4 floats between 0.0 and 1.0 for red, green, blue, and alpha.

“#rrggbbaa”: &str hex code.

c: ScadColor enum member.

alpha: The alpha channel for c.

children: A list of Scad objects separated and ending with a semicolon.

expansion: A Scad struct literal.

#patterns

color!([‘r: f64’, ‘g: f64’, ‘b: f64’, ‘a: f64’], ‘children: Scad’;);

color!(‘“#rrggbbaa”: &str’, ‘children: Scad’;);

color!(c=‘c: ScadColor’, ‘children: Scad’;);

color!(c=‘c: ScadColor’, alpha=‘alpha: f64’, ‘children: Scad’;);