If you store the desired hex value for the color in a session object, you can use it to set the background color of a page. I put the code in the pageGenerateBegin, but it may be better suited in the pageLoad section:
Code:
String dbColor="";
dbColor = (String) getSessionValue("pgBackGroundColor");
writeScript("document.bgColor='"+dbColor+"';");