[][src]Function geopattern::tiled_lines

pub fn tiled_lines(
    step_size: usize,
    (width, height): (usize, usize),
    ltr: &[bool],
    stroke: &[(&str, f32)],
    stroke_width: f32,
    background_color: &str
) -> Document

tiled lines

https://generativeartistry.com/tutorials/tiled-lines/

use geopattern::tiled_lines;

let c = tiled_lines(
    80,
    (2, 2),
    &(0..4).map(|i| i & 1 == 0).collect::<Vec<bool>>(),
    &(0..4)
        .map(|v| {
            (
                if v & 1 == 0 { "#222" } else { "#ddd" },
                0.02 + (v as f32) / 4.0,
            )
        })
        .collect::<Vec<(&str, f32)>>(),
    5.0,
    "#FFFFFF",
);

println!("{}", c);