title: convert to 3-digit hex color code
body: <p>I've been using 3-digit hex color values in CSS for a long time: <code>#fff</code>, <code>#999</code>, <code>#069</code>, etc. I can see how the repeating letters/numbers are merged to create a 3-digit hex color code, but I don't fully understand the pattern to be able to write a converter in PHP. Is there documentation for this?</p>
  
  <p><strong>Edit:</strong> Oh, perhaps my question wasn't clear. I need to know how some of the 6-digit hex color values are converted to 3-digits. <code>xxxxxx</code> (<code>ffffff</code>) and <code>xxyyzz</code> (<code>006699</code>) – these are the only two patterns, correct?</p>