diff --git a/static/js/ace2_inner.js b/static/js/ace2_inner.js index ec0d5dc45..6e61ac932 100644 --- a/static/js/ace2_inner.js +++ b/static/js/ace2_inner.js @@ -207,12 +207,22 @@ function OUTER(gscope) { bgcolor = fadeColor(bgcolor, info.fade); } - + + // Background dynamicCSS.selectorStyle(getAuthorColorClassSelector( getAuthorClassName(author))).backgroundColor = bgcolor; dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( getAuthorClassName(author))).backgroundColor = bgcolor; + + // Text color + var txtcolor = (colorutils.luminosity(bgcolor) < 0.45) ? 'ffffff' : '000000'; + + dynamicCSS.selectorStyle(getAuthorColorClassSelector( + getAuthorClassName(author))).color = txtcolor; + + dynamicCSSTop.selectorStyle(getAuthorColorClassSelector( + getAuthorClassName(author))).color = txtcolor; } } }