title: Get the base colours from a set of hex colours
body: <p>I have a set of colours and would like to break them down into 10 to 20 <em>base</em> colours. </p>
  
  <p>This should not be a pallet of what is passed in, rather independent of what is passed in. So if an image was used that was just various shades of red, it would return only red, possibly with light / dark red.</p>
  
  <p>EG: the colours I have are the boxes below, with an example of the output as lines. So from 21  colours the list is down to 8 in this example. </p>
  
  <p><img src="https://i.stack.imgur.com/qF8tY.png" alt="enter image description here"></p>
  
  <p>The hex values for above:</p>
  
  <pre><code>#000000
  #ffffff
  #003e9f
  #d61517
  #00a7bd
  #001070
  #a0210c
  #dc9103
  #e6151e
  #fdfdfd
  #011171
  #fbfd10
  #ffc500
  #fdc605
  #e6141d
  #faf703
  #544b20
  #796a3a
  #7a6b3a
  </code></pre>
  
  <p>Final output could be something like the outer ring of this colour wheel <img src="https://i.stack.imgur.com/dOTm7.gif" alt="enter image description here"></p>