FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. 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 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()
 
 






   
 
Updated: Fri Jul 15 16:35:30 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info