# Mondrian

Keeping it simple…

``````function setup() {
createCanvas(480,480);
}

function draw() {
noStroke();

fill(255,0,0);
rect(0,0, 214,200);

fill(255,255,0);
rect(0,324, 49,483);

fill(0,0,255);
rect(220,320, 140,135);

fill(0,0,0);
rect(213,0, 8,483);
rect(0,200, 474,10);
rect(0,314, 472,10);
rect(49,323, 8,483);
rect(358,319, 9,483);
rect(220,455, 360,9);
}
``````

# CSB – Mondrian

``````function setup() {
createCanvas(1000,1000);
}

function draw() {
c = color(180, 42, 23);  // Define color 'c'
fill(c);  // Use color variable 'c' as fill color
rect(0, 0, 420, 350);  // Draw left rectangle
strokeWeight(10);
line(420, 1000, 420, 0);
strokeWeight(10);
fill(line)
line(0, 350, 1000, 350);
strokeWeight(10);
line(0, 500, 1000, 500);
strokeWeight(10);
line(100, 500, 100, 1000);
strokeWeight(10);
line(800, 500, 800, 1000);
d = color(222, 184, 44);  // Define color 'c'
fill(d);  // Use color variable 'c' as fill color
rect(0, 500, 100, 1000);  // Draw left rectangle
e = color(6, 36, 83);  // Define color 'c'
fill(e);  // Use color variable 'c' as fill color
rect(420, 500, 500, 600);  // Draw left rectangle 6,36,83
}``````

# Assignment-03-Mondrian

While looking at some of Piet Mondrian’s works in preparation for this assignment, I noticed that the most famous of his works were just made of varying sized rectangles. So I sought out to develop a small program, which with a bit of manual work could recreate a scalable Mondrian painting. Here is my recreation of the assigned piece:

Here is my code, it contains a scalable rectangle class which can properly recreate and rectangule based drawing of any size with pixel data:

# Assignment 3 : Mondrian

Generative art is hard to visualize at first, but once one gets the hang of it, numbers and coordinates can be just as expressive (and then some) as traditional mediums of art. Using the compiler, that magical ethereal entity which makes all coding possible, I can turn these instructions:
``` void setup(){ size(800,800); background(0); noStroke(); fill(255,0,0); rect(0,0,340,300); fill(255); rect(360,0,500,300); rect(0,320,340,190); rect(360,320,500,190); rect(90,530,250,500); rect(630,530,500,500); rect(360,780,250,230); fill(0,0,255); rect(360,530,250,230); fill(255,255,0); rect(0,530,75,500); } void draw(){ }```
into this colorful image:

# Mondrian

``````function setup() {
createCanvas(681,685); //true size: 2043,2054 - Division by 3
background(206,218,213);

fill(102,110,98); //bottom border
noStroke();
triangle(0,685, 674,684, 674,686); //true size: 0,2054, 2022,2046, 2023,2054

fill(178,38,12); //red rectangle
rect(0,0, 310,289); //true size: 0,0, 931,868

fill(221,180,12); //yellow rectangle
rect(0,452, 73,235); //true size: 0,1355, 220,690

fill(2,32,88); //blue rectangle
rect(310,452, 209,201); //true size: 931,1355, 628,604

stroke(4,6,6); //black lines

//vertical lines - left to right
strokeWeight(9); //true size: 26
line(71,452, 71,686); //true size: 213,1362, 214,2054
strokeWeight(10); //true size: 30
line(308,0, 308,686); //true size: 924,0, 925,2043
strokeWeight(); //true size:
strokeWeight(10); //true size: 30
line(517,452, 518,686); //true size: 1551,1362, 1553,2054

//horizontal lines - top to bottom
strokeWeight(14); //true size: 42
line(0,288, 674,287); //true size: 0,864, 2021,862
strokeWeight(14); //true size: 43
line(0,449, 674,449); //true size: 0,1346, 2022,1346
strokeWeight(12); //true size: 35
line(310,651, 514,651); //true size: 930,1953, 1543,1953

fill(132,140,132);//border fills
noStroke();
triangle(0,0, 3,686, 0.686); //true size: 0,0 6,2054, 0,2054

fill(198,210,205);

stroke(187, 197, 193);
strokeWeight(1);
line(674,0, 674,686);

fill(102,110,98); //bottom border
noStroke();
triangle(682,685, 674,684, 674,686);

stroke(130,65,43); //signature

}

function draw() {

}
``````

# Mondrian

``````function setup() {
// put setup code here
createCanvas(473,480);
background(212,221,216);
strokeWeight(7);
line(216,0, 216,height);
line(50,315, 50,height);
line(363,315, 363,height);
line(217,456, 363,456);
strokeWeight(10);
line(0,202, width,202);
line(0,315, width,315);

noStroke();
fill(182,38,11);
rect(0,0, 213,197);
fill(224, 184, 8);
rect(0,320, 46,height-320);
fill(3,32,90);
rect(219,320, 141,133);

}

function draw() {
// put drawing code here
}``````

# Mondrian

```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 void setup() { size(500, 500); }   void draw() { background(219,229,221); fill(186,45,15); rect(0,0,200,200); fill(255,190,26); rect(0,300,50,200); fill(2,31,91); rect(200,300,175,175); strokeWeight(9); line(200,0,200,500); line(0,200,500,200); line(0,300,500,300); line(50,300,50,500); line(200,475,375,475); line(375,300,375,500); }```