https://answers.microsoft.com/en-us/windows/forum/all/high-contrast-themes-issue/ff386d33-dcfe-4116-8d4a-9c8cd06eb4c0
In the above link it says:
Windows 7's classic themes were rendered using GDI graphics rendering (the "Windows 98 graphics engine").
In Windows 8 and higher, the entire desktop is always drawn using the DWM graphics engine. That engine was formerly known as "Aero" in Windows 7 and Vista and back then it was optional, but now it's mandatory. For programs not built for Aero/DWM, it will cause this flash, particularly in "tablet mode" (it's less noticeable or even gone if you turn off tablet mode).
Shawn "Cmdr" Keene | Microsoft MVP 2010-2024 | CmdrKeene.com | tweet: @CmdrKeene
Microsoft MVPs are independent experts offering real-world answers. Learn more at mvp.microsoft.com.
Do you think that DWM has really anything to do with it?