[][src]Function geopattern::hypnotic_squares

pub fn hypnotic_squares(
    side: f32,
    min_side: f32,
    steps: usize,
    (width, height): (usize, usize),
    directions: &[(isize, isize)],
    stroke: &[(&str, f32, f32)],
    background_color: &str
) -> Document

Hypnotic Squares

https://generativeartistry.com/tutorials/hypnotic-squares/

use geopattern::hypnotic_squares;

let c = hypnotic_squares(
    60.0,
    30.0,
    5,
    (2, 2),
    &(0..4)
        .map(|i| {
            (
                (i % 3) as isize - 1,
                (2 * i % 3) as isize - 1,
            )
        })
        .collect::<Vec<(isize, isize)>>(),
    &(0..4)
        .map(|v| ("#222", 1.0, 1.0))
        .collect::<Vec<(&str, f32, f32)>>(),
    "#987987",
);

println!("{}", c);