Support HDR screens on macOS/iOS
See #17383 (closed) and #17692 (closed)
The previous work was reverted for 3.0, because of the issues mentionned in #17383 (closed) and also partly in #17692 (closed).
And improved with #17763 (closed) but not enough was done
So creating a new ticket for this for P3 displays