Search code examples
labview

Colors[4] not showing color selection on Front Panel


I am trying to set the color of an indicator to different colors based on different values, like 1 = red, 2 = blue etc. Using guidance from a Youtube video (accessible using this link: https://www.youtube.com/watch?v=czUmPQmKmGU), I have created a Colors[4] control for the indicator I have after changing it to the "write" function.

enter image description here

The Problem on the front panel is that I am getting a control with numbers instead of a color box where I can select the colors to show based on the value. This was the control I got instead.

enter image description here

This is the control I am trying to achieve (below):

enter image description here

Is there any way that I can get the color box on my control instead of the number controls? I am not sure if it can be changed through a control on the front panel or something but what I have tried so far keeps leading me back to this problem.

Any advice is much appreciated


Solution

  • A color box control is just a U32 number (three bytes for RGB and one which is always 0), which is why that's what you get.

    There is a right click plugin which adds a replace with color box option directly to the right click menu of unsigned 32 bit numbers, but I don't remember if it ships with LV or not.

    If you don't have that, you can always just right click the indicator inside the cluster, select replace and navigate the palettes to find the color box. You can also copy a color box and then select the indicator and paste, which replaces the selected control.