LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

color property

Hello wb2nvy,
 
The issue is that Ben's code is just doing the translations for a single U32 color.  Once you have the color, either from a color box control, U32 numeric control, etc., you need to build it into an array of 4 items.  Each item is a cluster.  Each cluster has 2 of those U32 numbers or color boxes.
 
I modified the code.  In the top half, I am using array and cluster functions to change both colors (fg & bg) of a single item in the array.  Then feeding that into the property node.  This is based on a color box control.
 
In the bottom half, I set up a 4 item array constant, Each item is a cluster of 2 color constants.  This is being fed into the property node of boolean2.
 
-Bill
0 Kudos
Message 11 of 25
(4,556 Views)
Bill thank you for that clarification. It took me awhile to duplicate the building of the color box array but I succeeded. However, as I understand it, the array pairs correspond to FG, BG. How do FG/BG relate to the upper/lower color boxes in each element of the array? I find I can locate a pair of color boxes side by side - horizontally so that seems to rule out an upper/lower correlation.
0 Kudos
Message 12 of 25
(4,545 Views)

Hello wb2nvy,

In each cluster, the color box which is item 0 is for the foreground color, item 1 is for the background color.  You can check which is which by selecting the cluster, right click, and select reorder controls in cluster.

Based on Ben's and Chris's replies, it is probably best to put the same color code in for both the fg and bg colors for all of the modern controls.  That way the property page dialog matches the actual fg colors that are used.  I still don't see where the bg color gets used in the modern controls.

The elements in the array work out as follows:

0: false     1: true       2: false going true      3: true going false

(Items 2 and 3 come into play on controls that have a "when released" operation.)

-Bill

0 Kudos
Message 13 of 25
(4,538 Views)
Bill thanks again for your help. All of you on this thread have shown me things I didn't learn in my Basics I and II training and would have taken forever to find in the help files, IF I knew what to ask in the help files. I wish there were a big huge book on LabView that I could kick back & read & highlight & thumb thru an index instead of knowing what question to ask of the help files. If anybody knows of a book, say, LabView for Dummies, please advise. And thanks again. I'm finding lots of answers to questions on this forum without having to post anything, and it's comforting to know other people are often asking the same questions.
0 Kudos
Message 14 of 25
(4,532 Views)
Here you go... one big book of EVERYTHING for LabVIEW. Or, rather, LabVIEW For Everyone🙂

http://www.amazon.com/LabVIEW-Everyone-Programming-Instruments-Instrumentation/dp/0131856723/sr=8-1/qid=1163603256/ref=sr_1_1/104-3863384-1564734?ie=UTF8&s=books

Message Edited by Aristos Queue on 11-15-2006 09:09 AM

0 Kudos
Message 15 of 25
(4,521 Views)

wb2nvy,

I find the best way to use the help files is to use context help.  Turn it on with Ctrl-H.  That is where I found the info for the colors(4) property.  Hovering over that property node brought up a little information, and then you can click on detailed help to get the full help system to come up with that info already selected.

I do this a lot when I see a VI icon I don't recognize to see what the VI is and what it does.  I usually discover how the more advanced functions work this way.

-Bill

0 Kudos
Message 16 of 25
(4,508 Views)

I thought I would chime in with some explaination of what is going on with the property pages and the propery node for the colors on the Boolean.

Before we get into that, lets talk about how colors are used generally in LabVIEW, as this may explain some other behavior that you may have noticed with the color squirt tool or color sampler tool.

LabVIEW controls are made up of cosmetic parts made up of images.  The word "image" here is a bit overloaded, but that is what we call them. An image in LabVIEW includes not only bitmaps, but also routines to draw the 3D/modern glyphs you see as buttons.  Images in LabVIEW, are free to define how they use the colors that they are passed, i.e. their foreground and background colors can be used or discarded as the image developer sees fit.  Generally, we have tried to be consistent here, but as this thread demonstrates the modern images are a departure from the classic images.

Here are some simple rules that we generally follow:

3D images generally only use their foreground colors.

2D images generally use both colors as you would expect.

Bitmaps images disregard the colors entirely.

System images either can use the colors or not depending if the theme of the system allows for it.  That is, on Windows XP if you sample the color of a Boolean, you will not get the light blue halo color, but instead some color that looks kind of greyish.

Now with that in mind, the property pages.  The property pages really don't know what kind of image is in the Boolean control, so when it queries the control for colors it only asks for the background color.  This gives a good (but incomplete) result for classic type images, but it is completely off for modern images, and is a source for confusion.

As shown in previous post, when it writes the colors properties, it writes both as the same color.  This way, it (kindof) works for both 2D and 3D images.  That said, these colors really don't make any sense for a system control or even a Boolean control customized with a custom bitmap.

Bill is spot-on about what the elements are for the array of colors that you pass to the colors property.

I don't know if anyone is still confused about this property or the property pages after reading this thread, it seems like you guys have it pretty figured out.  If anything is still confusing, please respond in this thread and I will try to answer anything about this that I can.

Jeff Peters

LabVIEW R & D

 

Message 17 of 25
(4,493 Views)

Hello everyone,

Wow - this is quite an impressive thread that does clarify many issues with LEDs in LabVIEW.  Just so you know, this issue was reported to R&D (#43E7CHXC) for further investigation into the possibility of improving the help for that property.

Thanks for helping us make LabVIEW an even better product!

Janell R | Applications Engineer

 

Message 18 of 25
(4,473 Views)

After awhile thumbing through Labview options, I have found that there is a way to change the colors of blinking booleans!!  Now problaby it is only me who cares, but the yellow is too loud.  By going to Tools> Options> colors,  there is options for changing blinking foreground and background colors.

Chris

Message 19 of 25
(4,462 Views)
THANKS CHRIS. THAT WAS MY NEXT QUESTION AND YOU ANSWERED IT. BTW, I just put in a requisition for LabView for Everyone by Travis & Kring. Hopefully now I won't take up so much space on this message board. Thanks again to all who helped me on this.
0 Kudos
Message 20 of 25
(4,437 Views)