from itertools import combinations_with_replacement def combinations_colors(l, n): return list(combinations_with_replacement(l,n))