Need help with fading a drawing
              in 
             Programming Questions 
              •  
              1 year ago    
            
 
           
             Hopefully someone can help me out.  The goal is to have random rectangles draw in different colors, which I have.  Now, I need to make older ones fade as new ones draw.  Any suggestions?
            
             
            
            
             
            
            
             
                
             
             
              
             
              
           
 
            
           
             This is the drawing part, I can't figure out the fade though:
            
            
              void setup() {
             
             
                size(500,500);
             
             
                smooth();
             
             
                background(0);
             
             
              }
             
             
              void draw() {
             
             
                noStroke();
             
             
                rect(random(500),random(500),random(35),random(35));
             
             
                fill(random(255),random(255),random(255),random(255));
             
             
              }
             
             
              
              1  
            
 
            
 
 
           
 
             
 
             
 
             
 
            