You should be able to set your container or other parent element to different CSS classes (for red, green or blue text) based on the string value. The following widget should help:
One quick and easy way to do this is create text boxes for all your different options (i.e. red, blue, green) and set their visibility to only display based on their contents (Something like: contains($textObj/text, ‘3’) then make blue text option visible)
I prefer the Enum Class widget ; https://appstore.home.mendix.com/link/app/2641/ , but it is also worth to check out the Dynamic Classes widget as suggested by Michael Giller
Thanks for your comments. However, i’m using a old modeler. Mendix 5.19. Wondering if any of the CSS code can solve this problem?