A while back i made a random background color generator. What was cool about that was it took a random color (actually, three) and determined whether it was generally visually dark or light, then used that determination to color the text accordingly light or dark gray for contrast.
So today, after not really working with PHP (or much code at all) for several years, i decided to revisit my experiment. Instead of either light or dark gray, i wanted to take the random colors i generated and lighten or darken them up, so they’re the same hue, just darker or lighter depending on the value of the generated color. The contrast is a lot more subtle, however. Maybe next i’ll see if i can add a contrast switcher to it.
Here’s the source code in either pretty HTML or plain text format.