GithubHelp home page GithubHelp logo

oovm / art-in-rust Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 385 KB

Piet Mondrian Artworks in Rust/Wasm

Home Page: https://oovm.github.io/mondrian-rs

License: Mozilla Public License 2.0

Rust 81.41% SCSS 15.55% HTML 3.04%
art rust wasm mondrian piet

art-in-rust's Introduction

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,
}

art-in-rust's People

Contributors

oovm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.