add:  var calcColor = ThisCalendarObject.color.replace( /#/g, "" ); var red = calcColor.substring( 0, 2 ); var green = calcColor.substring( 2, 4 ); var blue = calcColor.substring( 4, 6 );   var sum = parseInt( red, 16 ) + parseInt( green, 16 ) + parseInt( blue, 16 );   if ( sum < 256 ) tempStyleSheets[j].insertRule( "." + containerName + " { color:" + " white" + "!important;}", 1 ); 
context: function calendarColorStyleRuleUpdate( ThisCalendarObject ){   var j = -1;   var i;      // obtain calendar name from the Id   var containerName = ThisCalendarObject.Id.split(':')[2];   var tempStyleSheets = document.styleSheets;   for (i=0; i<tempStyleSheets.length; i++)   {      if (tempStyleSheets[i].href.match(/chrome.*\/skin.*\/calendar.css$/))	  {          j = i;          break;	  }   }   // check that the calendar.css stylesheet was found   if( j != -1 )   {	   var ruleList = tempStyleSheets[j].cssRules;	   var ruleName;	   for (i=0; i < ruleList.length; i++)	   {		  ruleName = ruleList[i].cssText.split(' ');		  // find the existing rule so that it can be deleted	      if (ruleName[0] == "." + containerName)		  {	         tempStyleSheets[j].deleteRule(i);	         break;	      }	   }	   // insert the new calendar color rule	   tempStyleSheets[j].insertRule("." + containerName + " { background-color:" +ThisCalendarObject.color + " !important;}",1);	}}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/a7527a4af41c8209dbcdba40693f64a74f64677b/calendarManager.js/clean/calendar/resources/content/calendarManager.js