I\'m trying to generate random HTML colors in PHP, but I\'m having trouble getting them to look similar, or in the same family. Is there some function I can use to generate
You could
You could widen the range of the modifier number (the one from 1 to 25) to get more variance in your color (you'd have to change the range of your base number as well, so you stay between 0 and 255).
I don't know anything about PHP, which is why I'm not putting code. But I thought it was an interesting question =)
EDIT: I realized that generating 3 random base numbers in step 1 will get you a less muted looking (grey) color. Then you can follow steps 2 and 3 to get different shades etc. as I already mentioned (and, as @Peter mentioned, increasing the modifier number at the risk of getting less "similar" colors)
Example output of this technique (based on two different sets of base numbers):
EDIT 2: Here is the PHP implementation of this by @Peter Ajtai
Base Color