LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I map integers corresponding to red, green, and blue to the colors(4) parameter of property node for a boolean indicator or control?

How do I map integers corresponding to red, green, and blue to the colors(4) parameter of the property node for a boolean indicator or control? I want to have three U32 inputs (red, green, and blue) to change the color of the boolean indicator. I'm stumped. The data structure of the boolean colors parameter is a 1-D array consisting of 4 cluster elements. The clusters contain two U32s. For example, to change the foreground of the boolean in the off state from red to yellow, I change the integer in the 0th array element and 1st integer (assuming that we start counting from 0, not 1) from 16711680 to 16318208? What's going on h
ere?
Message 1 of 5
(3,224 Views)
I can appreciate what you are going thru!

The four clusters represent the forground and backround colors of the boolean in each of its four states. The states are true, false, true-going-false, and false going true.

Write yourself a quick little test VI that reads all of the color array elements and show this array on the front panel. Right-click on the array indicators numeric indicator and do a replace with a color box (from numeric palette). use the paint brush to change the color and when the property node executes again you will see which array element changed.

The actual numeric representation of the color is a 32 bit value comprised of four eight bytes. The most significant byte is not used. The remain 3 eight bit bytes are RGB for red gren blue
. The eight bits bytes represent the level of that color in a range from 0 to 255. This is the same color values you see used in Paint, etc.

All zeros will give you black.

start increasing any one value, one of the three colors, RGB will increase gradually from black to max.

All three, RGB equal will give you a gray scale color.

You can break up the 32 number using the "split number function" from the advanced>>>data manipulation palette.

The inverse operation is also available on the same palette.

I think that covers most of the high points.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 5
(3,224 Views)
This what I mean about replacing the indicator.

Turn it around if you want to set teh colors.

It looks like I was wrong about forward background. That still seems to be a gray scale over-lay. The second cluster element does not seem to do much. See attached.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 3 of 5
(3,224 Views)
The second U32 in the cluster is currently unused. I'm not sure if they are planning to use it in future releases or not.
0 Kudos
Message 5 of 5
(3,224 Views)