2025-03-16 3:21 PM
Hi,
We have recently upgraded a project from TouchGFX v4.10 to v4.24, and have a question about colour representation. We haven't been able to update the HAL- this is a legacy project and we don't have access to the .ioc file.
We've replaced the deprecated getColorFrom24BitRGB function, which returned 16-bit values, with getColorFromRGB, which returns a 24-bit color. We have worked around this by adding calls to LCD16bpp::getNativeColor in the various setColor functions, ie:
void setColor(colortype newColor)
{
color = LCD16bpp::getNativeColor(newColor);
}
This works fine for the most part, boxes and most glyphs appear as the correct color (passed in to setColor as 24bpp, then converted to 16bpp using our workaround). But some glyphs are shifted to green/blue (white appears turquoise, light blue appears green), as though the conversion to 16bpp is getting repeated. This happens anywhere from 0 to 5 times within a text area, and all occurrences of a given glyph in a text area will be the same colour:
I understand that this is likely related to our HAL being out of date compared to TouchGFX, but if anyone is able to provide any insight on where the colour conversion from 24bpp to 16bpp is done in the newer versions of TouchGFX (since it is no longer done in the GetColor functions), it will help us work around this issue.
Thank you!