In this question I found a lot of interesting functions to generate random colors. But I need a random color generator that accept Hue, Saturation and Darkness range and also number of colors that we need. Actually I can write a random color generator but I don't have good understanding of relationship between color numbers and darkness, hue and saturation of a color. I want the function export colors in an array. I also made a jsfiddle file here for testing.
Thanks,
In CSS3 capable browsers, there's no need to transform HSL colors to RGB, since you can assign them just like that:
http://jsfiddle.net/5V8mV/1/
With that algorithm, you can easily restrict the colors to bluish tones for example: http://jsfiddle.net/DH2Bk/
In case you need an RGB conversion algorithm (for IE8, for example), you'll find it directly in the specs: http://www.w3.org/TR/css3-color/#hsl-color
Edit:
I just found a nice JS library with more options on https://github.com/davidmerfield/randomColor