rem: (function(){ var sanitize = function(c, low, high){    c = Number(c); return isNaN(c) ? high : c < low ? low : c > high ? high : c; };  dojo.extend(dojo.Color, { r: 255, g: 255, b: 255, a: 1, _set: function(r, g, b, a){ var t = this; t.r = r; t.g = g; t.b = b; t.a = a; }, setColor: function(/*Array|String|Object*/ color){    var d = dojo; if(d.isString(color)){ d.colorFromString(color, this); }else if(d.isArray(color)){ d.colorFromArray(color, this); }else{ this._set(color.r, color.g, color.b, color.a); if(!(color instanceof d.Color)){ this.sanitize(); } } return this; }, sanitize: function(){  var t = this; t.r = Math.round(sanitize(t.r, 0, 255)); t.g = Math.round(sanitize(t.g, 0, 255)); t.b = Math.round(sanitize(t.b, 0, 255)); t.a = sanitize(t.a, 0, 1); return this; }, toRgb: function(/*Boolean?*/ includeAlpha){  var t = this; return includeAlpha ? [t.r, t.g, t.b] : [t.r, t.g, t.b, t.a]; }, toRgba: function(){  var t = this; return [t.r, t.g, t.b, t.a]; }, toHex: function(){  var arr = dojo.map(["r", "g", "b"], function(x){ var s = this[x].toString(16); return s.length < 2 ? "0" + s : s; }, this); return "#" + arr.join(""); }, toCss: function(/*Boolean?*/ includeAlpha){  var t = this, rgb = t.r + ", " + t.g + ", " + t.b; return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")"; }, toString: function(){  return this.toCss(true); } }); })(); 
add: var arr = dojo.map(["r", "g", "b"], function(x){ var s = this[x].toString(16); return s.length < 2 ? "0" + s : s; }, this); 
context: (function(){	var sanitize = function(c, low, high){		// summary:		//		sanitize a color component by making sure it is a number,		//		and clamping it to valid values		c = Number(c);		return isNaN(c) ? high : c < low ? low : c > high ? high : c;	};		dojo.extend(dojo.Color, {		r: 255, g: 255, b: 255, a: 1,		_set: function(r, g, b, a){			var t = this; t.r = r; t.g = g; t.b = b; t.a = a;		},		setColor: function(/*Array|String|Object*/ color){			// summary:			//		takes a named string, hex string, array of rgb or rgba values,			//		an object with r, g, b, and a properties, or another dojo.Color object			var d = dojo;			if(d.isString(color)){				d.colorFromString(color, this);			}else if(d.isArray(color)){				d.colorFromArray(color, this);			}else{				this._set(color.r, color.g, color.b, color.a);				if(!(color instanceof d.Color)){ this.sanitize(); }			}			return this;	// dojo.Color		},		sanitize: function(){			// summary: makes sure that the object has correct attributes			var t = this;			t.r = Math.round(sanitize(t.r, 0, 255));			t.g = Math.round(sanitize(t.g, 0, 255));			t.b = Math.round(sanitize(t.b, 0, 255));			t.a = sanitize(t.a, 0, 1);			return this;	// dojo.Color		},		toRgb: function(/*Boolean?*/ includeAlpha){			// summary: returns 3 or 4 component array of rgb(a) values			var t = this;			return includeAlpha ? [t.r, t.g, t.b] : [t.r, t.g, t.b, t.a];	// Array		},		toRgba: function(){			// summary: returns a 4 component array of rgba values			var t = this;			return [t.r, t.g, t.b, t.a];	// Array		},		toHex: function(){			// summary: returns a css color string in hexadecimal representation			var arr = dojo.map(["r", "g", "b"], function(x){				var s = this[x].toString(16);				return s.length < 2 ? "0" + s : s;			}, this);			return "#" + arr.join("");	// String		},		toCss: function(/*Boolean?*/ includeAlpha){			// summary: returns a css color string in rgb(a) representation			var t = this, rgb = t.r + ", " + t.g + ", " + t.b;			return (includeAlpha ? "rgba(" + rgb + ", " + t.a : "rgb(" + rgb) + ")";	// String		},		toString: function(){			// summary: returns a visual representation of the color			return this.toCss(true); // String		}	});})();
meta: 4497	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4497/3d321e409b1157d94b682d6bfb6236d9d773aecf/Color.js/buggy/_base/Color.js