My M7 also has the purple problem. I've searched everywhere for the true fix, but the only one that people have had success with is to send it back for repair and it's not clear what the repair is, although it appears to be the image sensor.
I can't see that it is software as, surely, HTC would...