I'll draw your attention again to the config line
As per the documentation, bits 0-3 control the mode. You have them set to "5", therefore you are selecting mode 5 which is RGB666 (18bit mode), NOT mode 7 for RGB888 (24bit mode).
With mode 5 you'll be displaying the least significant bits of green as the most significant bits of blue, and will never drive red beyond 2bits out of the 8.
would be the first change I would suggest.
There are no standards for DPI panels, therefore you'll find examples for specific models, but those can not be treated as general solutions for panels of that resolution.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.