With that in mind, give these solutions a give a shot to sort out the problem.

Why Does My iPhones Screen Turns Unexpectedly Dim?

Yeah, thats exactly what has worked for me a few times.

Manually Adjust the Brightness of the Display and Reboot Your Device

So, see to it to try out this simple yet effective trick.

And when it happens, the colors do not appear to be consistent.

Hence, turn it off.

Turn OFF Attention Aware Features

Turn OFF Attention Aware Features

Another feature that might be causing the issue is Attention Aware.

Again, this is a pretty handy feature but in some cases, it may begin to ill-function.

In that case, the display of your iPhone may tend to dim without any rhyme or reason.

Disable Auto Brightness

Disable Auto-Brightness

Auto-brightness smartly adjusts the brightness of your iPhone based on the lighting conditions.

Hence, when you go out, the display turns bright.

In most cases, the auto-brightness feature works reliably on iPhone.

Reset All Settings

So, try turning off the auto-brightness to figure out if it resolves the problem.

Thus, its worth having a go.

Therefore, give it a shot as well.

Update software on your iPhone

Note that factory reset completely wipes out the entire existing configs and put them all in the default state.

Nonetheless, all your media and data remain safe.

So, updating the software would be a wise move.

I suspect there might some hardware failure or screen damage at the heart of the issue.

However, in some cases, the software update could also enable you to troubleshoot it.

And only on the rarest occasions, you might have to contact Apple for any technical assistance.