cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Change variable color depending on string?

Experimenter
Experimenter

Hi

 

Is it possible to change the color on a variable via a method?

E.g. If a string says "Empty" then the variable is green and "Full" gives red.

 ColorStatus.png

 

Thanks in advance

2 REPLIES

Re: Change variable color depending on string?

Phenom
Phenom
try
&CastStatus.color:=makeRGBValue(255,0,0) --simTalk 2.0 for red, 0,255,0 for green

or

ref(CastStatus).color:=makeRGBValue(255,0,0); -- old syntax

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net


Re: Change variable color depending on string?

Experimenter
Experimenter
Thank you, worked perfectly.