I am currently working with PHP code that random selects colors:
<div onclick="location.href='<?php the_permalink() ?>';"
style="cursor:pointer;background:#<?php
echo rand(0, 9); ?><?php
echo rand(0, 9); ?><?php
echo rand(0, 9); ?><?php
echo rand(0, 9); ?><?php
echo rand(0, 9); ?><?php
echo rand(0, 9); ?>;"
class="post bg thickbox"
id="thickbox post-<?php the_ID(); ?>">
What I would prefer to do is define a list of preferred colors in one PHP file, and then randomly sample an element from this list in the code above.
What is the correct PHP code for randomly sampling such a list of colors? How would you define the list of colors?