The noFill() function is used to disable the filling geometry. If noStroke() and noFill() function are called simultaneously then nothing will be drawn on the screen.
Syntax:
noFill()
Parameters: This function does not accept any parameter.
Below examples illustrate the noFill() function in p5.js:
Example 1:
function setup() {
createCanvas(400, 300);
}
function draw() {
background(220);
fill( 'green' )
rect(50, 50, 150, 150);
noFill();
rect(100, 100, 150, 150);
}
|
Output:

Example 2:
function setup() {
createCanvas(400, 300);
}
function draw() {
background(220);
noFill();
circle(140, 100, 150);
fill( 'green' )
circle(240, 100, 150);
}
|
Output:

Reference: https://p5js.org/reference/#/p5/nofill