
/* **** start define Colors (a collection of Color objects) **** */
colorapp.Colors = function() {
	this.c = [];
	this.init.apply(this,arguments);
};
	colorapp.Colors.prototype.init = function() {
		for( var i=0; i<arguments.length; i++ ) {
			this.c[this.c.length] = new colorapp.Color( arguments[i] );
		}
	};

	colorapp.Colors.prototype.getColors = function() {
		var ary = [];
		for( var i=0; i<this.c.length; i++ ) {
			ary[i] = this.c[i];
		}
		return ary;
	};

	/**
	 *	Returns a list of Color objects in an approximate order
	 *	of darkest color to lightest color - currently based on the 
	 *	Color object's Mean.of red, green, & blue colors.
	*/
	colorapp.Colors.prototype.getDarkToLight = function() {
		var ary = [];
		for( var i=0; i<this.c.length; i++ ) {
			ary[i] = this.c[i];
		}
		return ary.sort(this.sortMean);
	};
	colorapp.Colors.prototype.sortMean = function(a, b) {
		return a.sortValue('getMean') - b.sortValue('getMean');
	};

	/**
	 *	Returns a list of Color objects in an approximate order
	 *	of darkest color to lightest color - currently based on the 
	 *	Color object's Mean.of red, green, & blue colors.
	*/
	colorapp.Colors.prototype.getLightToDark = function() {
		var ary = [];
		for( var i=0; i<this.c.length; i++ ) {
			ary[i] = this.c[i];
		}
		return ary.sort(this.reverseSortMean);
	};
	colorapp.Colors.prototype.reverseSortMean = function(a, b) {
		return b.sortValue('getMean') - a.sortValue('getMean');
	};

/* **** end define Colors (a collection of Color objects) **** */

