How do I get all areas surrounded by a certain color in a multidimensional array?
For example, this map has three regions that are fully enclosed by red tiles. They are highlighted enclosed in pink.
I'd want the algorithm to return three regions, with the positions of the tiles inside them.
How can I do this?