xxxxxxxxxx
// testing javascript -> p5js by Perplexity AI
// Mondrian composition with red, blue, and yellow
// Sheng-Fen Chien <schien@mail.ncku.edu.tw>
// March 2010
function setup() {
// Create canvas 465x480
createCanvas(465, 480);
// Set background as black
background(0);
// Draw the largest red block
noStroke();
fill(231, 62, 23);
rect(120, 0, 465 - 120, 338);
// Draw the blue block
fill(82, 90, 165);
rect(0, 353, 108, 480 - 353);
// Draw the yellow block
fill(249, 244, 2);
rect(447, 425, 465 - 447, 480 - 425);
// Draw white blocks
fill(255, 255, 255);
// Left-top white block
rect(0, 0, 108, 135);
// Left-middle white block
rect(0, 155, 108, 338 - 155);
// Bottom-middle white block
rect(120, 353, 437 - 120, 480 - 353);
// Above yellow white block
rect(447, 353, 465 - 447, 407 - 353);
}
function draw() {
// No continuous drawing needed; all shapes are drawn in setup()
}