Text color changes based on author color

This commit is contained in:
Marcel Klehr 2012-01-23 18:40:54 +01:00
parent d881cefbc9
commit 228543a30e
1 changed files with 12 additions and 5 deletions

View File

@ -207,12 +207,19 @@ function OUTER(gscope)
{
bgcolor = fadeColor(bgcolor, info.fade);
}
dynamicCSS.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author))).backgroundColor = bgcolor;
dynamicCSSTop.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author))).backgroundColor = bgcolor;
// Text color
var txtcolor = (colorutils.luminosity(colorutils.css2triple(bgcolor)) < 0.45) ? '#ffffff' : '#000000';
var authorStyle = dynamicCSS.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author)));
authorStyle.backgroundColor = bgcolor;
authorStyle.color = txtcolor;
var authorStyleTop = dynamicCSSTop.selectorStyle(getAuthorColorClassSelector(
getAuthorClassName(author)));
authorStyleTop.backgroundColor = bgcolor;
authorStyleTop.color = txtcolor;
}
}
}