In Matthew 27:28, the Roman soldiers are said to have put a scarlet (Greek kokkinos) robe upon Jesus. In Mark 15:17,20 and John 19:2,5, it is said to have been purple (Greek porphura or porphurous). The following quotes seek to explain the apparent contradiction.
"The scarlet colour was obtained from a species of fruit; purple from shell-fish...The ancients gave the name purple to any colour that had a mixture of red in it, and consequently these different colours might be sometimes called by the same name. The robe here used was the same kind worn by Roman generals and other distinguished officers of the Roman army, and also by the Roman governors. It was made so as to be placed on the shoulders, and was bound around the body so as to leave the right arm at liberty. As we cannot suppose that Pilate would array him in a new and splendid robe, we must suppose that this was one which had been worn and cast off as useless, and was now used to array the Son of God as an object of ridicule and scorn." -- Albert Barnes, Barnes' Notes Volume 9, page 307.
"Mark mentions purple instead of scarlet, changing the colours, but we need not sweat over this. It is not likely that Christ was dressed in a precious robe: we may gather it was not real purple but something that had a resemblance to it, as a painter imitates the real thing in his pictures." -- John Calvin, Calvin's New Testament Commentaries, Volume 3, page 190 (Morrison translation).
"Stripping Jesus of his own garments, they arrayed him in a scarlet robe, perhaps a soldier's cloak, faded to resemble royal purple (Mark 15:17)." --Homer A. Kent in The Wyclife Bible Commentary, (the commentary on Matthew), page 982.