Because that computer was originally released with the Vista OS, I'm a little surprised the machine worked with Windows 10. When I visited the HP site for your computer, there are drivers for Windows 7, so that explains why it functions best with Win7 and an external monitor, but if the purple screen still continues, your only option is to install, or have a repair shop install a new laptop screen.
Still, it might be worthwhile visiting the HP site in my link above, download the latest Video driver and install it. It won't cost anything.
Hope this helps.
Grif
Hp pavilion dv7 1137us
Was running win 10 for nearly a year. about a month ago after a update I attenpted to log on and all I got was a purple screen. I shut down and re started and got a pale light blue screen. No desk top icons. After a couple trys I got a screen with the normal fix options. I selected safe mode and got in tried seveal things on reboot. same color screen no desktop. I plugged in a flat screen monitor and everything works . If I look real close I can see a faint image of what is on the monitor in the laptop screen. I have since reloaded win 7 with all updates. the laptop works great as a desk top using the external monitor.
Any suggestions as to a fix?

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic