p5.js Color Complete Reference

Create color and store it into variables of color datatype. The parameters of color are RGB or HSB value depending on the current colorMode() function.
| Function | Description | 
|---|---|
| alpha() | It is used to extract the alpha value from a color or pixel array. | 
| blue() | It is used to extract the blue value from a color or pixel array. | 
| brightness() | It is used to extract the HSB brightness value from a color or pixel array. | 
| color() | It creates color and store it into variables. | 
| green() | It is used to extract the green value from a color or pixel array. | 
| hue() | It is used to extract the HSB and HSL hue value from a color or pixel array. | 
| lerpColor() | It is used to interpolate two colors to find a third color between them. | 
| lightness() | It is used to extract the HSL lightness value from a color or pixel array. | 
| red() | It is used to extract the red value from a color or pixel array. | 
| saturation() | It is used to extract the HSL and HSB saturation value from a color or pixel array. | 
| background() | It sets the color used for the background of the p5.js canvas. | 
| clear() | It is used to clear the pixels within a buffer. | 
| fill() | It is used to fill the color of the shapes. | 
| noFill() | It is used to disable the filling geometry. | 
| noStroke() | It removes the outline which is used to draw lines and borders around shapes. | 
| stroke() | It is used to draw the lines and border around the text and shapes. | 
| erase() | It subtracts all the drawings that would be done after the use of this function. | 
| noErase() | It is used to cancel the effects of the erase() function. | 
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, zambiatek Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
 
				 
					


