mondrian

Crates.iomondrian
lib.rsmondrian
version1.1.0
sourcesrc
created_at2020-11-07 15:29:49.152065
updated_at2020-11-07 17:11:01.917212
descriptionPiet Mondrian Artworks
homepage
repositoryhttps://github.com/GalAster/mondrian-rs
max_upload_size
id309656
size6,225
SasakiSaki (oovm)

documentation

README

Piet Mondrian Artworks in Rust

Usage

use mondrian::{save, Mondrian};

fn main() {
    let mut s = Mondrian::default();
    save("iter-5.svg", &s.generate(5)).unwrap();

    s.new_rng(); // Otherwise it will generate exactly the same graphics
    s.line_width = 0.8;
    save("iter-10.svg", &s.generate(10)).unwrap();
}

Options

pub struct Mondrian {
    /// Canvas size
    pub size: f32,
    /// Graphic width
    pub width: f32,
    /// Available colors
    pub colors: Vec<String>,
    /// Color Weights
    pub color_weights: Vec<u32>,
    /// Grid size
    pub grid_round: f32,
    /// Line width
    pub line_width: f32,
    /// Random seed
    pub rng: StdRng,
}
Commit count: 5

cargo fmt