Is a Knapsack Problem with only Color Constraints NP-Complete?
So, items have only 2 parameters:


Color. I assume that each item has one color ("one of C colors"). If not, this problem is probably $\mathsf{NP}$-hard.
Price.


Now we need to pack a knapsack to maximize the price. Knapsack can have at most $k$ colors.

Algorithm:


For each color count the total price of items that are colored by color $C_i$. Call these values $P_i$. Takes linear time.
Find $k$ maximal values of $P$. Takes polynomial (linear?) time. Can be done using sorting.


This is the answer.