Skip to main content
Tweeted twitter.com/StackGIS/status/869882808948461570
Post Reopened by PolyGeo
Post Closed as "Duplicate" by PolyGeo
edited tags
Link
Don
  • 815
  • 2
  • 12
  • 27
Source Link
Don
  • 815
  • 2
  • 12
  • 27

How to ensure different colors for surrounding polygons?

Currently in the client I have an array of colors that is looped through for a given set of geometry features. Features are grouped together on the map and each group has a color assigned to it. It is not taking into account adjacent group polygons such that two adjacent groups may have the same color if the array of groups is longer than the color array.

Is there a simple way to assign colors such that no two adjacent groups have the same color?