* "Violent" is a color descriptor: While we usually associate "violent" with aggression, it can also describe a very bright, intense shade of color. So, a "violent dress" could be a very vivid purple.
* Sunlight enhances color: Sunlight is rich in all colors of the rainbow. When sunlight hits a purple dress, it reflects the violet wavelengths back to our eyes, making the color appear even more vibrant.
So, the joke is that the dress is "violent" in its intensity, and this intensity makes it appear "violet" in the sunlight.