 |
 |
 |
Name |
|
background() |
 |
|
|
Examples |
|
 |
background(51);
|
 |
 |
background(255, 204, 0);
|
 |
 |
PImage b;
b = loadImage("laDefense.jpg");
background(b);
|
 |
|
Description |
|
The background() function sets the color used for the background of the Processing window. The default background is light gray. In the draw() function, the background color is used to refresh the display window between frames. It is possible to load a JPG or GIF image as the background by loading an image which is the same size as the display window. The image must be in the data directory of the sketch for it to load properly. |
 |
|
|
Syntax |
|
background(value1)
background(value1, value2, value3)
background(image)
|
 |
|
|
Parameters |
|
value1 |
|
int or float: red or hue value (depending on the current color mode)
|
value2 |
|
int or float: green or saturation value (depending on the current color mode)
|
value3 |
|
int or float: blue or brightness value (depending on the current color mode)
|
image |
|
PImage: the name of a PImage the same size as the display window
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
colorMode() |