You could just do;
<?php $hex = dechex(rand(17,200)) . dechex(rand(17,200)) . dechex(rand(17,200)); ?>
Then, use this in the body tag;
<body BGCOLOR=“#<?php echo($hex);?>”>