LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color (including saturation) of an element based on input

Hello,

 

I need a program that takes a simple element, let's say a square of some sort, and change its color depending on some text input, in this case it demonstrates the temperature (so if the temperature is between 19 and 21°C, the color should be a pale green, below that it should go from pale blue to rich blue, and above that from pale red to rich red). The problem is that I'm a bloody beginner with LabVIEW, as in the only programm I have ever done is a "walking light" (think Knight Rider car), which worked but was badly done. I would be happy if any of you could point me in a direction on what to look for, because I'm really clueless. Thanks in advance

0 Kudos
Message 1 of 5
(3,566 Views)

You haven't given enough information.  Specifically, what is this "simple element" you are talking about?

Is it an object in a 3D view?  Part of a 2D image?  A decoration on the front panel?

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 5
(3,562 Views)

A simple 2D decoration on the front panel, just a quadratic shape on which the color change will be visualized. A colorbox would be an option in this case I guess?

0 Kudos
Message 3 of 5
(3,543 Views)

Yes, colorbox is good choice to display a number of different colors.

Then you need to map your values into colors. 

Make array of input value bounds - when it should change color and array of corresponding colors (basic color table), then threshold 1D array function will allow to map them. 

 

For continuous change of color it can be formula mapping input range to colors (R, G, B separately) or lookup color table interpolation

0 Kudos
Message 4 of 5
(3,521 Views)

Hi atten,

 

apart from colorboxes, which are a natural choice for displaying colors, you can change the colors of (mostly) all FP elements using property nodes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(3,505 Views)