[][src]Function geopattern::hexagons

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

hexagons

use geopattern::hexagons;

let c = hexagons(
    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);