My iPhone 6 randomly restarts

My iPhone 6 screen has been turning a random color (red or blue) and then it shows an apple logo then turns on again. It has been happening for a few days now. I throw my phone every once in a while when I get mad (no noticeable damage or cracks because I have a case). Is anyone familiar with this who can help me? The phone is about 2 years old and hasn't had many problems. I'm currently on iOS 8.1.2

Either your digitizer is broken and needs to be replaced or you damaged the storage device or the data stored on it. Might be a good idea to restore it with itunes to get a new install of iOS.