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.