/* Copy of Piet Mondrian's Composition with Red, Blue and Yellow (1930) Processing sketch by Michael Goldwasser */ size(400, 300); background(255); // white noStroke(); // will do black lines separately smooth(); // softer edges // red sections fill(250, 0, 0); // slightly muted rect( 80, 0, 110, 86); rect(240, 86, 76, 101); rect( 30, 250, 50, 50); // blue sections fill(0, 0, 240); rect(190, 0, 126, 86); rect(316, 86, 43, 101); rect( 79, 187, 159, 58); // yellow sections fill(240, 240, 0); // red+green = yellow rect( 26, 0, 53, 86); rect(316, 0, 43, 86); rect(316, 187, 43, 58); rect( 79, 245, 159, 55); // time to draw the thick black lines // (which will cover rectangle edges) stroke(0); // black strokeCap(SQUARE); // clean edge strokeWeight(9); // horizontal lines line(0,86,400,86); line(0,187,359,187); line(26,245,400,245); // vertical lines line(26,0,26,300); line(79,0,79,300); line(190,0,190,187); line(238,86,238,300); line(316,0,316,245); line(359,0,359,300); save("myMondrian.jpg");