This problem involves permutation since we are dealing with different ways that the colors of the 7 balls can be arranged distinctly. The equation of permutation is described as

There are 7 balls in this problem, hence, n = 7. Also, 7 colors are selected at each process of arranging them by color, hence, r = 7. Substitute it on the equation above and compute, we get

The expression above can be simplified as

Answer: E. 5040