This is how Paint's bucket fill works (Flood fill algorithm)