olha o exemplo ae, adicionei algumas cores. script testado ok. <script>
texto=new Array();
texto[0]="blue";
texto[1]="red";
texto[2]="green";
texto[3]="yellow";
texto[4]="gray";
texto[5]="black";
texto[6]="cyan";
x=Math.random()*6;
x=Math.round(x);
document.bgColor=texto[x];
</script>