title: How to get random light color
body: <p>I want to <strong>randomly generate a color hex code</strong> with Javascript. This color needs to be light enough to place black font on it. </p>
  
  <p>What is the best way to ensure a light color is being generated? Will it help to limit <code>letters</code> in the following <em>function</em>? </p>
  
  <pre><code>function getRandomColor() {
      var letters = '0123456789ABCDEF'.split(''),
          color = '#';
      for(var i = 0; i &lt; 6; i++ ) {
          color += letters[Math.floor(Math.random() * 16)];
      }
      return color;
  }
  </code></pre>