iPhone OLED如何设置纯红色像素全屏

How to set pure red pixel full screen on iPhone OLED

我正在研究iPhoneOLED屏幕的像素排列。 我使用代码:

for (int i = 0; i < height; i++)
{
    for (int j = 0; j < width; j++)
    {
        data[(i*width + j)*4] = (Byte) (255) ;
        data[(i*width + j)*4+1] = (Byte) (0) ;     
        data[(i*width + j)*4+2] = (Byte) (0) ;  
        data[(i*width + j)*4+3] = (Byte)255;
    }
 } 

在viewController中,当设置iPhoneX全屏为红色时,用显微镜看到的iPhoneX的屏幕像素不全是红色像素,而是绿色也可以先看到像素。

我想实现的是当设置为纯红色时,iPhoneX的像素只显示红色像素,不能显示绿色像素或蓝色像素
我该如何解决这个问题?

尝试使用系统颜色:

view.backgroundColor = UIColor.systemRed 

iOS 提供了一系列系统颜色,可自动适应活力和辅助功能设置的变化,例如增加对比度和降低透明度。 https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/