add maximal number of colors, add tests