  Given integers $r \geq 2$, $k \geq 3$ and $2 \leq s \leq \binom{k}{2}$, and a
graph $G$, we consider $r$-edge-colorings of $G$ with no copy of a complete
graph $K_k$ on $k$ vertices where $s$ or more colors appear, which are called
$\mathcal{P}_{k,s}$-free $r$-colorings. We show that, for large $n$ and $r \geq
r_0(k,s)$, the $(k-1)$-partite Tur\'an graph $T_{k-1}(n)$ on $n$ vertices
yields the largest number of $\mathcal{P}_{k,s}$-free $r$-colorings among all
$n$-vertex graphs, and that it is the unique graph with this property.
