How about

```php
return '#' . dechex(mt_rand(1, 16777215));
```

??