Reference for Processing (BETA) version 0135+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
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 clear the display window at the beginning of each frame.
An image can also be used as the background for a sketch, however its width and height must be the same size as the sketch window. It is not possible to use transparency (alpha) in background colors with the main drawing surface, however they will work properly with createGraphics. |
||||||||||||||
Syntax | background(gray) background(gray, alpha) background(value1, value2, value3) background(value1, value2, value3, alpha) background(color) background(color, alpha) background(hex) background(hex, alpha) |
||||||||||||||
Parameters |
|
||||||||||||||
Usage | Web & Application | ||||||||||||||
Related | stroke() fill() tint() colorMode() |