you are right, that's a problem, need be considered carefully.
we need to make sure a smaller block is always nested in a bigger block, and the end of color always ahead a beginning of color if they have same pos.