Hello and welcome to Apple Support Communities AlexPersi,
Thank you for contacting us. You have come to the right place and we are happy to assist you. We understand you're seeing purple lines when in dark mode intermittently. We can understand why you’d reach out for a solution. We see that you have the most current operating system installed. There could be a couple reasons why you could be seeing this. First does it do it in light mode? Are you connected to secure Wi-Fi with password? Or is it happening when using cellular data?
Adjust the screen brightness and color on iPhone - Toggle each setting in the article and see if the issue occurs.
Get started with accessibility features on iPhone - Toggle the settings in this article, paying close attention to Smart Invert, Color Filters, Transparency.
Make sure you have backups prior to making any major system changes: How to back up your iPhone, iPad, and iPod touch
After going thru both articles to check the settings, if you are still having issues, please reach out so we can continue to troubleshoot.
Thank you for contacting Apple Support Communities.
Best regards.