lib/toxi/color/ColorList.js
function(){
		var r = 0,
			g = 0,
			b = 0,
			a = 0;

		this.each(function(c){
			r += c.rgb[0];
			g += c.rgb[1];
			b += c.rgb[2];
			a += c.alpha();
		});

		var num = this.colors.length;
		if(num > 0){
			return TColor.newRGBA(r / num, g / num, b / num, a / num);
		}
		return undefined;
	}
function(){
		var r = 0,
			g = 0,
			b = 0,
			a = 0;

		this.each(function(c){
			r += c.rgb[0];
			g += c.rgb[1];
			b += c.rgb[2];
			a += c.alpha();
		});

		var num = this.colors.length;
		if(num > 0){
			return TColor.newRGBA(r / num, g / num, b / num, a / num);
		}
		return undefined;
	}
function ( ) { var r = 0 , g = 0 , b = 0 , a = 0 ; this . each ( function ( c ) { r += c . rgb [ 0 ] ; g += c . rgb [ 1 ] ; b += c . rgb [ 2 ] ; a += c . alpha ( ) ; } ) ; var num = this . colors . length ; if ( num > 0 ) { return TColor . newRGBA ( r / num , g / num , b / num , a / num ) ; } return undefined ; }
Calculates and returns the average color of the list.
@return average color or null, if there're no entries yet.
Calculates and returns the average color of the list .