LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of color box depending on measurement values

Yes you're right - it's dark and maybe a little spooky. I like this - although I have to admit that I'm not half the dark and disturbing as the icon.
 
Thanks for leaving me the "Tour de color box" win - at least one situation I was the fastest Smiley Very Happy.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 11 of 16
(921 Views)

Becktho,

I'm not sure a color box would work because my version is changing the color of an indicator and uses a different data type.  If I'm wrong (good chance at that since I'm still new to this) could you post a vi with what you mean.

Thanks

0 Kudos
Message 12 of 16
(917 Views)
  I'm not sure of your question, but feeding the color box constant value to the "color" property will have the same effect, the color box constant is just a way to visually represent a number that represents a color, so that we don't have to remember that 16774466 is a shade of yellow. 
  Most control color properties are in the form of an array of cluster of "Foreground"/"Background" colors, so it is a little more than just wiring to the property node. Easiest way in that instance is to have your constants (in the case statement) be array constants with the desired colors.
 
P.M.

Message Edited by LV_Pro on 07-29-2005 11:17 AM

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 13 of 16
(910 Views)
In you vi you wire an array with a cluster of numbers to the property-node. Right-click on a numeric value and select replace. Replace the numeric value with a color box constant. It doesn't matter if you use the numeric value or the constant - your code just becomes a little bit more readable.
 
LV_Pro: Something old often is wiser than something young...
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 14 of 16
(903 Views)

Works great, I didn't realize I could put a color box inside the array

Thanks for everyones help.

0 Kudos
Message 15 of 16
(893 Views)
The attached color utilities offer yet another way of doing this.  Color is technically "hue".  In the attached VIs you can specify a color by its hue, a value from 0 to 255.  This is a circular scale, so 0 is red, and 255 is red with just a hint of blue.  It cycles through red, yellow, green, cyan, blue, magenta, and red as you go 0 to 255.  The grayscale set is similar.  Grayscale of 0 is black.  Grayscale of 255 is white.  The VIs offer a convenient way to set and query for hue and grayscale, as well as change either relative to their current position.
Message 16 of 16
(882 Views)