setup()
setup() runs once when the sketch starts. It initializes the canvas size, sets the background color, and configures drawing settings. Using windowWidth and windowHeight makes the sketch responsive to browser resizing.
function setup(){
createCanvas(windowWidth,windowHeight);
background(5,30,10);
noStroke();
}
Line by Line:
createCanvas(windowWidth,windowHeight)- Creates a canvas that fills the entire browser window, making the sketch responsive to window size
background(5,30,10)- Sets the initial background to a very dark green color (RGB: 5,30,10), creating a nature-like dark canvas
noStroke()- Disables stroke (outline) for all shapes, so only filled shapes will be drawn