Google News
logo
p5.js - Interview Questions
What is the fill() Function in p5.js?
The fill() function sets the color used to fill a shape with the specified color. It must be called prior to drawing the shape. The default fill color is white.
 
function draw(){
  // Sets the fill color of the circle to blue
  fill(0, 0, 255);
  circle(100, 100, 25);
}
Advertisement