The color() function is used to create a variable of the type color. This is handy if you need to create colors you can use anywhere in your sketch. In this example, I’ve declared a color variable named c, before the setup() function.
The fill() function is used to set the fill color of the shape you’re about to draw. It can be used with one to four parameters. You can also use a color variable for this.
The noFill() function is used to disable the fill before you draw a shape to the screen.
The stroke() is similar to the fill() function, but sets the color for the stroke of the shape you want to draw.
The noStroke() function is used to disable the stroke before you draw a shape to the screen.
The background() function is used to set the background color. This will usually be the first function you’ll use inside the draw() function, as it will clear the screen. You can’t use transparent colors with this function. If you do, the alpha value will be ignored.
The first parameter in colorMode() is used to set the color mode. This can be either RGB or HSB. The default color mode is RGB, with values between 0 and 255.
You can use colorMode( RGB, 1.0 ) to use values between 0 and 1 for the color
components. If you want to use HSB colors, you’ll usually use colorMode( HSB,
360, 100, 100 ), as these numbers are used in most graphics applications.