rem: if (color) rule.style.color = getContrastingTextColor(color); 
add: rule.style.color = getContrastingTextColor(color); 
context: function updateStyleSheetForObject(object) {    var calStyleSheet = getCalendarStyleSheet();    var name;    if (object.uri)        name = object.uri.spec;    else        name = object.replace(' ','_');    // Returns an equality selector for calendars (which have a uri), since an    // event can only belong to one calendar.  For categories, however, returns    // the ~= selector which matches anything in a space-separated list.    function selectorForObject(name)    {        if (object.uri)            return '*[item-calendar="' + name + '"]';        return '*[item-category~="' + name + '"]';    }        function getRuleForObject(name)    {        for (var i = 0; i < calStyleSheet.cssRules.length; i++) {            var rule = calStyleSheet.cssRules[i];            if (rule.selectorText && (rule.selectorText == selectorForObject(name)))                return rule;        }        return null;    }        var rule = getRuleForObject(name);    if (!rule) {        calStyleSheet.insertRule(selectorForObject(name) + ' { }',                                 calStyleSheet.cssRules.length);        rule = calStyleSheet.cssRules[calStyleSheet.cssRules.length-1];    }    var color;    if (object.uri) {        color = getCalendarManager().getCalendarPref(object, 'color');        rule.style.backgroundColor = color;        if (color)            rule.style.color = getContrastingTextColor(color);        return;    }    var categoryPrefBranch = prefService.getBranch("calendar.category.color.");    try {        color = categoryPrefBranch.getCharPref(object);    }    catch(ex) { return; }    rule.style.borderColor = color;    rule.style.borderWidth = "2px";}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ea0a19bbff318452a3dd971a2d778d5c35d82b4a/calendarManagement.js/clean/calendar/resources/content/calendarManagement.js