Text color changes based on author color
This commit is contained in:
parent
d881cefbc9
commit
49061175c9
|
@ -207,12 +207,22 @@ function OUTER(gscope)
|
||||||
{
|
{
|
||||||
bgcolor = fadeColor(bgcolor, info.fade);
|
bgcolor = fadeColor(bgcolor, info.fade);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Background
|
||||||
dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
dynamicCSS.selectorStyle(getAuthorColorClassSelector(
|
||||||
getAuthorClassName(author))).backgroundColor = bgcolor;
|
getAuthorClassName(author))).backgroundColor = bgcolor;
|
||||||
|
|
||||||
dynamicCSSTop.selectorStyle(getAuthorColorClassSelector(
|
dynamicCSSTop.selectorStyle(getAuthorColorClassSelector(
|
||||||
getAuthorClassName(author))).backgroundColor = bgcolor;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue