Skip to main content
LMath.2
Associate
January 5, 2022
Solved

Color corruption of text in TouchGFX 4.18.1

  • January 5, 2022
  • 2 replies
  • 2067 views

I created my project in TouchGfx 4.15.0. Currently I'm using TouchGfx 4.18.1. After flashing/debugging ; color of the text which I've given in TouchGfx is getting corrupted. For ex : If I set red(235 ,64 ,61) color to some text, after debugging it becomes a color close to blue. But if the text color is white, it's not getting corrupted. Someone please provide a solution for this matter.

This topic has been closed for replies.
Best answer by LMath.2

#define ConvertTextColor(RED, GREEN, BLUE) (uint32_t)( ( (RED << 8 ) & 0xF800) + ( (GREEN << 3) & 0x07E0) + ( (BLUE >> 3) & 0x003F) )

Add this macro in Color.hpp

Then call this macro whereever you want. For ex :

Text.setColor(TextColourConvert(Red, Green, Blue) );

8)

2 replies

Romain DIELEMAN
ST Employee
January 11, 2022

Hi,

What MCU are you working with ? Are you working with a custom project or from one of the TBS avaialble in TouchGFX Designer ?

I would suggest to regenerate code from STM32CubeMX to make sure to update the Firmware package (opening your project in STM32CubeMX and migrate to the latest version).

/Romain

DHoff.3
Visitor II
January 26, 2022

Hello,

I have same issue. I'm using custom board with STM32F767 mcu, display color depth 16 bit, L8 image formats and IDE Keil uVision5. Colors in the pictures are ok. Problem is with colors got by function getColorFromRGB(r, g, b). For example color (32, 60, 82) was changed to (57, 137, 131) (these values were taken from attached "frame buffer screenshots").

TouchGFX 4.16:

0693W00000JNQ2PQAX.pngTouchGFX 4.18.1:

0693W00000JNQ2oQAH.png 

Romain DIELEMAN
ST Employee
January 26, 2022

Have you tried regenerating code from STM32CubeMX as well ?

/Romain

DHoff.3
Visitor II
January 27, 2022

No I haven't. My project is multitarget and regenerating makes troubles.