title: How to generate a random DARK hex color code with PHP?
body: <p>Please note that I have already read <a href="https://stackoverflow.com/questions/5614530/generating-a-random-hex-color-code-with-php">Generating a random hex color code with PHP</a> and I got help from that question too. But my question is different to that question.</p>
  
  <p>I am going to create 1000+ images with some text like below image.</p>
  
  <p><a href="https://i.stack.imgur.com/2vlCR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2vlCR.jpg" alt="enter image description here"></a></p>
  
  <p><strong>Text color is always white</strong>. I need to generate background color randomly. I use following code to generate random color.</p>
  
  <pre><code>&lt;?php
  
  function random_color_part() {
      return str_pad( dechex( mt_rand( 0, 255 ) ), 2, '0', STR_PAD_LEFT);
  }
  
  function random_color() {
      return random_color_part() . random_color_part() . random_color_part();
  }
  
  echo random_color();
  
  ?&gt;
  </code></pre>
  
  <p>This script generate light colors like white, light yellow, light blue too. I need to remove them. Because if the background color is also light colour it is hard to read the text.</p>
  
  <p>So is there way to modify this code generate only dark colors?</p>