6. D.
$$
A_{5}^{5}-3\left(A_{2}^{2} A_{2}^{2} \cdot 3\right) A_{2}^{2}=48
$$
6. It is known that there are two people each wearing red and yellow clothes, and one person wearing blue clothes. Now, arrange these five people in a row, requiring that people wearing the same color clothes cannot be adjacent. Then the number of different arrangements is ( ) .
(A) 24
(B) 28
(C) 36
(D) 48