title: Dynamic Choice of Colors
body: <p>I have a leaflet map and I want to assign colors to each "feature." The number of features can be different depending on changing geojson data. I am guessing there is some algorithm to do this. </p>
  
  <p>Here is the code: (on each feature I would like to set the color to be different not the given color, because the data doesn't have a color)</p>
  
  <pre><code>var geomap = L.geoJson(geojson, {
              //TODO: change the colors to be randomly separated and updated based on the # of features
              //TODO: Should change the feature properties to be the population and zone number -- show this in the pop-up instead of the "description"
              style: function (feature) {
                  return {color: feature.properties.color};
              },
              onEachFeature: function (feature, layer) {
                  layer.bindPopup(feature.properties.zone);
              }
          });
  </code></pre>
  
  <p>So if I have 5 or 100 features I want to have different colors for each. Any hints or algorithms? This is in JavaScript obviously. </p>