Sets the color used to fill shapes.
Calling fill(255, 165, 0) or fill('orange') means all shapes drawn after the fill command will be filled with the color orange.
The version of fill() with one parameter interprets the value one of three ways. If the parameter is a Number, it's interpreted as a grayscale value. If the parameter is a String, it's interpreted as a CSS color string. A p5.Color object can also be provided to set the fill color.
The version of fill() with three parameters interprets them as RGB, HSB, or HSL colors, depending on the current colorMode(). The default color space is RGB, with each value in the range from 0 to 255.
The version of fill() with four parameters interprets them as RGBA, HSBA, or HSLA colors, depending on the current colorMode(). The last parameter sets the alpha (transparency) value.
Examples
Syntax
fill(v1, v2, v3, [alpha])
fill(value)
fill(gray, [alpha])
fill(values)
fill(color)