Background will not fade to white
              in 
             Programming Questions 
              •  
              2 years ago    
            
 
           
             In a number of programs that I have been writing recently I've wanted to draw a semi-opaque "background" using the rect() function in order to fade out everything that I have been drawing in a program. Here's a simple example:
            
            
            
 
           
 
            
           - int l = 20;
 - void setup()
 - {
 - size(800, 400);
 - background(255);
 - }
 - void draw()
 - {
 - fill(255, 7);
 - rect(0, 0, width, height);
 - pushMatrix();
 - translate(mouseX, mouseY);
 - noFill();
 - stroke(0);
 - rect(-l/2, -l/2, l, l);
 - popMatrix();
 - }
 
 
              
              1  
            
 
            