xxxxxxxxxx
27
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
// Draw a circle
fill(255, 0, 0); // Red color
noStroke(); // No outline
ellipse(width / 2, height / 2, 200, 200);
// Draw a square
fill(0, 0, 255); // Blue color
rectMode(CENTER); // Draw the rectangle from the center
rect(width / 2, height / 2, 150, 150);
// Draw a triangle
fill(0, 255, 0); // Green color
triangle(width / 2, height / 2 - 100, width / 2 - 100, height / 2 + 100, width / 2 + 100, height / 2 + 100);
// Draw a line
stroke(255); // White color for the stroke
strokeWeight(4); // Thick stroke
line(0, height / 2, width, height / 2);
}