I had to generate ~unique colors for various nodes recently. So I used:
<?php '#' . substr(md5($node->title), 0, 6) ?>
Some of the colors are hideous, but they're relatively distinct within a collection of nodes.