background()
Color / SettingDescription
Sets the color used for the background of the Processing window. Called in draw() to clear the canvas each frame.
Syntax
void background(float gray)
void background(float gray, float a)
void background(float r, float g, float b)
void background(float r, float g, float b, float a)
void background(color c)
void background(const PImage& img)
Parameters
| Name | Type | Description |
|---|---|---|
| gray | float | grayscale value (0-255) |
| r | float | red component |
| g | float | green component |
| b | float | blue component |
| a | float | alpha (optional) |
| img | PImage | image to use as background |
Returns
voidRelated
Under the Hood
Implementation in Processing.h / Processing.cpp:
Loading...