Text color changes based on author color

pull/362/head
Marcel Klehr 2012-01-22 13:30:25 +01:00
parent d881cefbc9
commit 49061175c9
1 changed files with 11 additions and 1 deletions

View File

@ -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;
}
}
}