LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make a color bar

Hi,

 

I would like to create a color bar independently of any other graph objects.

I already made a vi which shows the resulting colors. You can set 3 different Colors and the vi creates and Displays the other Colors depending on the number of Color steps equidistantly. What I miss is some sort of indicator i.e. which value the respective color stands for. Usually in color bars there is some sort of y axis displaying the values. Any suggestions how I could achieve this?


Regards

0 Kudos
Message 1 of 7
(5,573 Views)

Hi volfi,

 

you can use the color bar (aka z axis) of an intensity chart/graph to display your color ramp!

Or you use a colorbox array as you do now…

Best regards,
GerdW


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

It is unclear what, precisely, you wish to do.  Several things are "doable", some harder than others.

  • Do you want an indicator that changes color as a function of time or space?  By "time", I mean a Color Box that starts, say, as Red, then over some period of time changes to Orange, then Yellow, etc., while by "space" I mean a (static) indicator that has red at one end and purple (or some other color) at the other?
  • Do you want the color to vary "discretely" or "continuously"?  By "discrete", I mean "vary over N (maybe up to 100) different colors, without transitions", and "continuous" means a smooth gradation from starting color to ending color.

Varying over time is pretty straight-forward, so I'll assume you mean varying over space.  Varying discretely is also pretty straightforward, so I'll assume you mean varying continuously.  Now, that's tricky!  The only way I can think to do this is by "pixel-painting" (my as-yet-not-copyrighted term for making an image one pixel at a time) -- you create a Picture or IMAQ Image of a certain size, having a certain number of pixels, then you do a "discrete" coloring of each pixel according to some algorithm you determine to pick your color.

 

Note that there are (at least) two ways to specify a color (in LabVIEW) -- RGB, where you specify the amount of Red, Green, and Blue (light) in each pixel, and HSL, where you specify the Hue (Color), Saturation, and Luminance.  For doing a Color Bar, you might find HSL is a more "natural" scale, and there are utilities that can convert HSL to RGB that you can use.

 

Bob Schor

0 Kudos
Message 3 of 7
(5,553 Views)

Sure I can use the Color box Array, but it doesnt Show the respective values. How can I extract the Color bar from the intensity Chart? I don't want  to Display the rest of the graph.

0 Kudos
Message 4 of 7
(5,551 Views)

Hi volfi,

 

when you don't need the chart/graph display, but just the color bar, you could make the chart/graph very small and transparent. (Hide all parts you don't need…)

Best regards,
GerdW


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

Thanks for the reply. According to your Definition I want to implement Variation over space. I Choose some Color and the number of steps between These Colors. The number of steps corresponds to the number of Elements in the Array of Color boxes. That's already done in the vi and is output as an Array of Color boxes. What I would like to do is to drow a thin line between These Color boxes and write the according value which I've already calculated before. I hope this makes my Problem clearer

0 Kudos
Message 6 of 7
(5,532 Views)

Hi volfi,

 

check.png

What happens when you hide the graph display and only leave the z axis display visible?

(You can display up to 256 colors, the first index is used for underrange, the last for overrange values.)

Best regards,
GerdW


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