code: function(rgb) {
  		var r,g,b;
  		if (typeof(rgb) == 'object') {
  			r = rgb.r;
  			g = rgb.g;
  			b = rgb.b;
  		} else if (typeof(rgb.match) == 'function'){
  			var parts = rgb.match(/^rgb\((\d+),(\d+),(\d+)\)$/);
  			if (parts) {
  				r = parts[1];
  				g = parts[2];
  				b = parts[3];
  			}
  		}
  		if (isNaN(r) || isNaN(b) || isNaN(g)) {
  			throw new TL.Error("invalid_rgb_err");
  		}
  		return "#" + TL.Util.intToHexString(r) + TL.Util.intToHexString(g) + TL.Util.intToHexString(b);
  	}
docs: given an object with r, g, and b keys, or a string of the form 'rgb(mm,nn,ll)', return a CSS hex string including the leading '#' character