rem: Xinha._colorToRgb = function(v) { if ( !v ) { return ''; } var r,g,b;   function hex(d) { return (d < 16) ? ("0" + d.toString(16)) : d.toString(16); }  if ( typeof v == "number" ) {  r = v & 0xFF; g = (v >> 8) & 0xFF; b = (v >> 16) & 0xFF; return "#" + hex(r) + hex(g) + hex(b); }  if ( v.substr(0, 3) == "rgb" ) {  var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/; if ( v.match(re) ) { r = parseInt(RegExp.$1, 10); g = parseInt(RegExp.$2, 10); b = parseInt(RegExp.$3, 10); return "#" + hex(r) + hex(g) + hex(b); }   return null; }  if ( v.substr(0, 1) == "#" ) {  return v; }   return null; 
add: Xinha._colorToRgb=function(v){ if(!v){ return ""; } var r,g,b; function hex(d){ return (d<16)?("0"+d.toString(16)):d.toString(16); } if(typeof v=="number"){ r=v&255; g=(v>>8)&255; b=(v>>16)&255; return "#"+hex(r)+hex(g)+hex(b); } if(v.substr(0,3)=="rgb"){ var re=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/; if(v.match(re)){ r=parseInt(RegExp.$1,10); g=parseInt(RegExp.$2,10); b=parseInt(RegExp.$3,10); return "#"+hex(r)+hex(g)+hex(b); } return null; } if(v.substr(0,1)=="#"){ return v; } return null; 
context: Xinha._colorToRgb = function(v){  if ( !v )  {    return '';  }  var r,g,b;  // @todo: why declaring this function here ? This needs to be a public methode of the object Xinha._colorToRgb  // returns the hex representation of one byte (2 digits)  function hex(d)  {    return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);  }  if ( typeof v == "number" )  {    // we're talking to IE here    r = v & 0xFF;    g = (v >> 8) & 0xFF;    b = (v >> 16) & 0xFF;    return "#" + hex(r) + hex(g) + hex(b);  }  if ( v.substr(0, 3) == "rgb" )  {    // in rgb(...) form -- Mozilla    var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;    if ( v.match(re) )    {      r = parseInt(RegExp.$1, 10);      g = parseInt(RegExp.$2, 10);      b = parseInt(RegExp.$3, 10);      return "#" + hex(r) + hex(g) + hex(b);    }    // doesn't match RE?!  maybe uses percentages or float numbers    // -- FIXME: not yet implemented.    return null;  }  if ( v.substr(0, 1) == "#" )  {    // already hex rgb (hopefully :D )    return v;  }  // if everything else fails ;)  return null;};
meta: 6015	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/6015/d8776708e0e10dfa0ab6ee1d0fa9e512d8d16348/XinhaCore.js/clean/packages/acs-templating/www/resources/xinha-nightly/XinhaCore.js