LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

converting a int color to an RGB

I have a integer returned from get background color of a tab in an Easy tab. For example 16777011, which is yellow. I need to get the int into the form of 3 numbers such as red, blue green. How do I do this?
0 Kudos
Message 1 of 2
(3,779 Views)
Here's an abstract from the on-line help for GetCtrlAttribute (Attribute: Text Background Color):

Description: The RGB color value of the text background. ...
RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB, with the respective red, green, and blue components. See MakeColor().

In your example: 16777011 = 0xFFFF33, that is Red = 255, Green = 255, Blue = 51, which gives yellow

Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(3,779 Views)