Gradient

Flowing from one color to the other, taking the percentage of red, green and blue for each point.

function BzgGradient(colorAcolorB) {
    
this.colorA colorA;
    
this.colorB colorB;
    
    
this.rA = (colorA >> 16) & 255;
    
this.gA = (colorA >> 8) & 255;
    
this.bA colorA 255;
    
    
this.rB = (colorB >> 16) & 255;
    
this.gB = (colorB >> 8) & 255;
    
this.bB colorB 255;
    
    
this.colorAt = function(perc) {
        return     
            
Math.round(perc this.rA + (perc) * this.rB) << 16 |
            
Math.round(perc this.gA + (perc) * this.gB) << |
            
Math.round(perc this.bA + (perc) * this.bB);
    }
    
    
this.draw = function() {
        var 
icolorwidth 900;
        
document.write('<div class="gradient">');
        for (
0widthi++) {
            
color this.colorAt(/ (width 1)).toString(16);
            while (
color.length 6color '0' color;
            
document.write('<div class="bar" style="background: #' color ';"></div>');
        }
        
document.write('</div>');
    }