Color Formats :
1 - Monochrome : "0" being black and "255" being white. Anything in between are the shades of grey.
fill (Monochrome(0-255))
Example: fill (130);
2 - RGB : RGB stands for Red, Green and Blue. Red takes 0 as minimum value and 255 as maximum value
anything in between are the shades of red, same is for Green(0-255) and Blue (0-255).
fill (Red(0-255), Green(0-255), Blue(0-255))
Example: fill (255, 100, 50);
3 - Hex : Hex values are represented with a hash sign with six digits which are the combination numbers(0-7) and letters(a-f).
The first set of two digits is for Red colour , second set of two digits is for Green and the third set of two digits is for Blue colour.
Example: fill ("#f70ce5");
Three functions take in colours as their parameter background(), fill() and stroke().
Background :
Fill :
Alpha : value creates transparency effect when added as the fourth parameter
when using RGB values for creating colour.Alpha values ranges from 0 - 255.
fill ( R, G, B, Alpha(0 - 255))
Example: fill (175, 50, 125, 10);
Stroke :
3D colour : For the 3D shapes in p5.js have the normalMaterial() function to give 3D colour to the shape.
Alternative ways to give colour to a 3D shape : Use fill() and stroke() functions to give colour to the 3D shape.