Common color change

<< Click to Display Table of Contents >>

Navigation:  Examples > Change the color of an object >

Common color change

Previous pageReturn to chapter overviewNext page

We create tag with name State:

tagstate

Depending on the tag's value we want to change fill color of the Rectangle object (instead of the Rectangle there can be other objects and instead of the fill color property there can be other color properties):

rectangleex

For example we want to have fill color Red if our (State) tag's value equal 0, and fill color Green if tag's value not equal 0. We need to enable Fill color property and fill it like this:

statefillcolor

Click OK to confirm your changes and Run simulation to check your settings:

commonfillcolor