Grouping blocks per color