Generate a random HTML grey value

October 29, 2011

Similar to theĀ randomColor function, but only for shades of grey:

function randomGrey() {
  var s = "#";
  var grey = randomRange(0,15).toString(16);

  while(s.length < 7) {

  return s;

I really wish js had more built-in string methods.

Want to be notified when I publish new content?

Enter your email below to join my mailing list!