The library could not display some color correctly #2322
-
I tried to fill the colour with 0x3D8B, which is a green colour, I used both pushImage(0x3D8B) and fillScreen(), but both of them returned the wrong colour, which is close to blue colour. The only thing that can display the colour correctly is fillScreen(tft.color565(56, 178, 92)), which is I have to use color565 to let the colour display correctly. but if I want to show some pictures with pushImage(), then I could not display the image's colour correctly. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The screen has a 16 bit colour interface this is the 565 RGB format. So 24 bit 888 format colours must be converted to a new 16 bit value. That is what the color565 function does. If you try to write: Then only the 16 bits 0xb25c will be used. |
Beta Was this translation helpful? Give feedback.
-
Hi!
What am I doing wrong? I tried tft.setSwapBytes(true) and tft.setSwapBytes(false). Also the calibration screen is off. It should be red and white, but it is black and blue...
Help! |
Beta Was this translation helpful? Give feedback.
The screen has a 16 bit colour interface this is the 565 RGB format. So 24 bit 888 format colours must be converted to a new 16 bit value. That is what the color565 function does. If you try to write:
tft.fillScreen(0x38b25c)
Then only the 16 bits 0xb25c will be used.