Matthew 27:28
28 And they stripped him, and put on him a scarlet robe.
John 19:2
2 And the soldiers platted a crown of thorns, and put it on his head, and they put on him a purple robe,
Matthew's account says scarlet, John's says purple (twice, also John 19:5).
Firstly, who even decides what color is which? If you google both colors, even in our modern standardized internet culture, there are around 30 options for "scarlet", and same goes with purple.
On this spectrum, there's a lot of overlap. In the light purple, we start seeing more or less the same as dark scarlet.
Matthew saw fit to call it scarlet, John called it purple. This has happened in my life personally multiple times where I disagreed with someone on color.
So, what color was it? It was a color somewhere between scarlet and purple, evidently.
If you strain at this gnat, you miss the point of the passage. Christ's robe was colored to represent the blood that was about to be shed. The robe was a sanguineous color.
Human authors, who are both telling the 100% truth from God, have different ways of expressing what they saw from different points of view. Realizing this obvious truth is the solution to almost every single alleged "contradiction" you will encounter.