Set Color Palette Using Code

Cats777

Member
Is it possible to set the colors of the palette with a bit of code? I could store it in a variable (e.g. var h = "@primaryLight"), but I can't figure out how to do it the other way around. I would like to dynamically set the tone of the forums under certain conditions.
 
I want to make my board have a day/night cycle. I already wrote the code to check the server time and change the background image if necessary, but I'd like to go all out and change the board's color palette as well.
 
Here are time-based conditionals that can be used in the HTML templates (not the CSS templates):

http://xenforo.com/community/threads/time-based-board-header.15298/

Within the HTML you can conditionally display inline styling or class names, where the classes are later defined in the CSS. For example, if you want to change the body background then you can edit PAGE_CONTAINER and conditionally include inline styling in the <body> tag.
 
Actually, being unfamiliar with Xen tags, I wrote the background changer in JavaScript. I don't know which is more efficient, but it works. What I want to do now is figure out how to directly change the color palette, because writing something to change the colors of each div on the board would be a hassle.
 
Just so you know, I tried figuring out a way to do this and asked around as well, and was sadly unable to figure out a way.

What I was able to do was use two different skins (thus two different color palettes), and what you could do is add a link to change the style somewhere in the header, there might even be a way to change the skin based on the time.
 
Top Bottom