[][src]Function geopattern::diamonds

pub fn diamonds(
    (diamond_width, diamond_height): (f32, f32),
    (width, height): (usize, usize),
    fill: &[(&str, f32)],
    stroke: (&str, f32),
    background_color: &str
) -> Document

diamonds

use geopattern::diamonds;

let c = diamonds(
    (20.0, 20.0),
    (2, 2),
    &(0..4)
        .map(|v| {
            (
                if v & 1 == 0 { "#222" } else { "#ddd" },
                0.02 + (v as f32) / 4.0,
            )
        })
        .collect::<Vec<(&str, f32)>>(),
    ("#ddd", 0.2),
    "#987987",
);

println!("{}", c);