LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feeding hex value into a color property node throws error

Solved!
Go to solution

@cayenne wrote:
Then in the properties of the numeric constant...I found where to toggle between display format (hex or decimal).

 



Just an FYI, when using Hex display for numerics (constants, controls, indicators, etc.), right click on the numeric and select Visible->Radix.  This will show a little "x" in front of the number.  This way it is obvious that we are using Hex values.  Furthermore, if the radix is being shown, you can click on the radix to choose what display format to use.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 13
(634 Views)

@DavidCorney wrote:

Part of my confusion was...that everything I was reading said that it was expecting a hex code for a RGB value in the color propery....I'd only gotten that it had to be either I32 or U32 from ya'll answer on this thread.

 

Is U32 better than I32 for some reason...it seemed to work with either as I play with it...

 


The property expects an unsigned 32 bit integer (U32). A U32 allows you to represent decimal numbers in the range 0 to 4294967295. With a signed 32 bit integer (I32) the most significant bit is used to represent the sign of the number. This gives you a number range between -2147483648 and 2147483647. What this means is that an I32 will work, but as has been noted, LabVIEW will coerce the datatype to a U32.

 

Showing the numbers using hexadecimal does not change the binary value, simply the way the number is displayed (Base 16). A value of 4294967295 decimal is Hex FFFFFFFF. Each pair of numbers (e.g. FF) represents a value between 1 and 255 decimal, making it easier to read the data (once you get the hang of base 16 :-).That is why the RGB colors are represented by 3 bytes of data as 000000 to FFFFFF in Hex. The additional byte (4 bytes = 32 bits), as has been explained, is used by LabVIEW for special colors, such as transparent.

 

Hope the above helps.


It absolutely helps!!!

 

THANK YOU!

0 Kudos
Message 12 of 13
(630 Views)

@crossrulz wrote:

@cayenne wrote:
Then in the properties of the numeric constant...I found where to toggle between display format (hex or decimal).

 



Just an FYI, when using Hex display for numerics (constants, controls, indicators, etc.), right click on the numeric and select Visible->Radix.  This will show a little "x" in front of the number.  This way it is obvious that we are using Hex values.  Furthermore, if the radix is being shown, you can click on the radix to choose what display format to use.


Thank you...that answers another one of my questions I'd been wondering about...what 'radix' was....

 

THANK YOU!

 

C

0 Kudos
Message 13 of 13
(628 Views)