Let a partition of a planar polygon into colored polygons be given, i.e. something similar to [![enter image description here][1]][1] We know the coordinates of the vertices and the color of each part, e. g. in such a way `Graphics[{EdgeForm[Black], Green, Polygon[{{1, 0}, {0, Sqrt[3]}, {-1, 0}}], EdgeForm[Black], Brown, Polygon[{{1, 0}, {0, Sqrt[3]}, {2, 0}}]}]`. How to write a Mathematica program which unites the polygons having a joint edge and the same color into a single polygon? For the above partition we have to obtain two green polygons, one red polygon, one yellow polygon, one blue polygon, and one violet polygon. Addition. The following result in green [![enter image description here][2]][2] is not a polygon so is not allowed. [1]: https://i.sstatic.net/HFzbq.gif [2]: https://i.sstatic.net/mgT3F.gif