cancel
Showing results for 
Search instead for 
Did you mean: 

Changing wildcard text color?

HHarj.1
Senior

Hi,

I would like to announce measurement results also by text and change the text color based on the results. Green text for a pass, red for failure. How could I do this?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III
#include <touchgfx/Color.hpp>
...
textArea.setColor(Color::getColorFrom24BitRGB(0xFF, 0x00, 0x00)); //Red
textArea.setColor(Color::getColorFrom24BitRGB(0x00, 0xFF, 0x00)); //Green
textArea.setColor(Color::getColorFrom24BitRGB(0x00, 0x00, 0xFF)); //Blue

View solution in original post

2 REPLIES 2
Martin KJELDSEN
Chief III
#include <touchgfx/Color.hpp>
...
textArea.setColor(Color::getColorFrom24BitRGB(0xFF, 0x00, 0x00)); //Red
textArea.setColor(Color::getColorFrom24BitRGB(0x00, 0xFF, 0x00)); //Green
textArea.setColor(Color::getColorFrom24BitRGB(0x00, 0x00, 0xFF)); //Blue

Romain DIELEMAN
ST Employee

Hi,

the textArea widget has the capability to change the text color.

textArea1.setColor(touchgfx::Color::getColorFrom24BitRGB(255, 0, 0));  //red here

To modify it directly in View you might need to include the path for the color setup (and do not forget to invalidate afterwards as well): #include <touchgfx/Color.hpp>