I have this method to generate me random colors for font:
function getRandomRolor() {
var letters = \'0123456789ABCDEF\'.split(\'\');
var color = \'#
As you know RGB at 0,0,0
is black the darkest and it goes toward getting light until (255,255,255) so you can stop it to go above 100, to get only dark colors or say 9 in hex:
Here is jsFiddle
function getDarkColor() {
var color = '#';
for (var i = 0; i < 6; i++) {
color += Math.floor(Math.random() * 10);
}
return color;
}