lib/toxi/color/accessors.js
function make( type, setters ){
		var name = type + 'Accessor', arry = type.toLowerCase(); //make HSV hsv etc
		exports[name] = function( comp ){
			this.component = comp;
			//compare() could easily be used in incorrect scope, bind it
			this.compare = bind( this.compare, this );
		};

		exports[name].prototype.compare = function( a, b ){
			var ca = a[arry][this.component],
				cb = b[arry][this.component];
			return numberComparator( ca, cb );
		};

		exports[name].prototype.getComponentValueFor = function( col ){
			return col[arry][this.component];
		};

		exports[name].prototype.setComponentValueFor = function( col, val ){
			col[ 'set'+setters[this.component] ]( val );
		};

	}
function make( type, setters ){
		var name = type + 'Accessor', arry = type.toLowerCase(); //make HSV hsv etc
		exports[name] = function( comp ){
			this.component = comp;
			//compare() could easily be used in incorrect scope, bind it
			this.compare = bind( this.compare, this );
		};

		exports[name].prototype.compare = function( a, b ){
			var ca = a[arry][this.component],
				cb = b[arry][this.component];
			return numberComparator( ca, cb );
		};

		exports[name].prototype.getComponentValueFor = function( col ){
			return col[arry][this.component];
		};

		exports[name].prototype.setComponentValueFor = function( col, val ){
			col[ 'set'+setters[this.component] ]( val );
		};

	}
function make ( type , setters ) { var name = type + 'Accessor' , arry = type . toLowerCase ( ) ; //make HSV hsv etc exports [ name ] = function ( comp ) { this . component = comp ; //compare() could easily be used in incorrect scope, bind it this . compare = bind ( this . compare , this ) ; } ; exports [ name ] . prototype . compare = function ( a , b ) { var ca = a [ arry ] [ this . component ] , cb = b [ arry ] [ this . component ] ; return numberComparator ( ca , cb ) ; } ; exports [ name ] . prototype . getComponentValueFor = function ( col ) { return col [ arry ] [ this . component ] ; } ; exports [ name ] . prototype . setComponentValueFor = function ( col , val ) { col [ 'set' + setters [ this . component ] ] ( val ) ; } ; }
this will attach proper exported objects for each accessor
this will attach proper exported objects for each accessor