title: Extracting top 2-3 hex colors from images in R
body: <p>I am wondering if it is possible to extract out the main hex colors from image files containing team sports logos. I have the following vector of logos: </p>
  
  <pre><code>dput(team.logos[1:5))
  c("https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa/500/399.png", 
  "https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa/500/2066.png", 
  "https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa/500/42.png", 
  "https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa/500/311.png", 
  "https://a.espncdn.com/combiner/i?img=/i/teamlogos/ncaa/500/160.png")
  </code></pre>
  
  <p>Using the following website (<a href="https://html-color-codes.info/colors-from-image/" rel="nofollow noreferrer">https://html-color-codes.info/colors-from-image/</a>) - I am able to see that the hex color values in the first image (UAlbany) are <code>#FEBE10</code> for yellow, and <code>#3F1E6B</code> for the purple, as well as white.</p>
  
  <p>My question is - is there any way to scrape these hex values for each image in my vector in R (so I don't have to manually load each image and click to find each hex value). </p>
  
  <p>Thanks!</p>