Jump to content

Color: Difference between revisions

From LabVIEW Wiki
Eyesonvis (talk | contribs)
No edit summary
Fix layout
Line 1: Line 1:
{{TOCright}}<br>
'''Colors''' are represented in LabVIEW by an unsigned 32-bit integer. The integer is of the hexadecimal form 0x00RRGGBB, where RR, GG, and BB represent the red, green, and blue components of the color, respectively.


'''Colors''' are represented in LabVIEW by an unsigned 32-bit integer. The integer is of the hexadecimal form 0x00RRGGBB, where RR, GG, and BB represent the red, green, and blue components of the color, respectively.<br>
== Special cases ==


= Special cases<br>  =
LabVIEW uses the upper byte (00) for special colors, normally this byte is used for transparency so using these color values in a different program might give odd results.


LabVIEW uses the upper byte (00) for special colors, normally this byte is used for transparency so using these color values in a different program might give odd results. <br>
== Transparent  ==


== Transparent<br>  ==
Transparent has a color value 0x01000000 the last bit of the transparency byte is high, this can be used to create 'holes' controls:


Transparent has a color value 0x01000000 the last bit of the transparency byte is high, this can be used to create 'holes' controls:<br>
== System Background  ==


== System Background<br>  ==
This color turns the background into the background of the front-panel/block diagram. It's value is 0x01000037, special details: [[System Label|System_Label]].


This color turns the background into the background of the front-panel/block diagram. It's value is 0x01000037, special details: [[System Label|System_Label]].<br>
== System Color  ==


== System Color<br>  ==
LabVIEW supports [http://blog.eyesonvis.com/2010/04/29/system-colors-dont-believe-your-eyes/ six system colors], they match on Windows different color types:


LabVIEW supports [http://blog.eyesonvis.com/2010/04/29/system-colors-dont-believe-your-eyes/ six system colors], they match on Windows different color types:<br>
{| class="wikitable"
 
! colspan="3" | System color table  
{| width="600" cellspacing="1" cellpadding="1" border="1" align="left"
|+ System color table  
|-
|-
! scope="col" | LabVIEW color name<br>
! LabVIEW color name
! scope="col" | Windows color name<br>
! Windows color name
! scope="col" | LabVIEW color value<br>
! LabVIEW color value
|-
|-
| Panel and Object<br>
| Panel and Object
| COLOR_3DFACE<br>  
| COLOR_3DFACE
| 0x01000016<br>
| <code>0x01000016</code>
|-
|-
| Panel and Object text<br>
| Panel and Object text  
| COLOR_BTNTEXT<br>  
| COLOR_BTNTEXT
| 0x01000006<br>
| <code>0x01000006</code>
|-
|-
| Window<br>
| Window
| COLOR_WINDOW<br>  
| COLOR_WINDOW
| 0x0100000A<br>
| <code>0x0100000A</code>
|-
|-
| Window text<br>
| Window text
| COLOR_WINDOWTEXT<br>  
| COLOR_WINDOWTEXT
| 0x0100000C<br>
| <code>0x0100000C</code>
|-
|-
| Highlight<br>
| Highlight
| COLOR_HIGHLIGHT<br>  
| COLOR_HIGHLIGHT
| 0x01000008<br>
| <code>0x01000008</code>
|-
|-
| Highlight text<br>
| Highlight text
| COLOR_HIGHLIGHTTEXT<br>  
| COLOR_HIGHLIGHTTEXT
| 0x01000009<br>
| <code>0x01000009</code>
|}
|}


<br>
[[File:ColorDropDownSystem.png]]
 
<br><br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
[[Image:ColorDropDownSystem.png]]<br>
 
<br>


There's a VI on ni.com that demonstrates all the LabVIEW system colors, which includes many more than can be selected from the color picker dialog: [http://zone.ni.com/devzone/cda/epd/p/id/4125]
There's a VI on ni.com that demonstrates all the LabVIEW system colors, which includes many more than can be selected from the color picker dialog: [http://zone.ni.com/devzone/cda/epd/p/id/4125]


= User colors  =
== User colors  ==


LabVIEW has additional colors that are used for specific elements, like the tank fill color, here's an overview of these colors and their LabVIEW color value, these are not stored with a special value, the following lists the default values for these colors. LabVIEW defines 15 colors per default, but has support for 3 additional colors.  
LabVIEW has additional colors that are used for specific elements, like the tank fill color, here's an overview of these colors and their LabVIEW color value, these are not stored with a special value, the following lists the default values for these colors. LabVIEW defines 15 colors per default, but has support for 3 additional colors.  


<br>
{| class="wikitable"
 
! colspan="2" | LabVIEW color table  
{| width="600" cellspacing="1" cellpadding="1" border="1" align="left"
|+ LabVIEW color table  
|-
|-
! scope="col" | default LabVIEW color name  
! Default LabVIEW color name  
! scope="col" | Default LabVIEW color value
! Default LabVIEW color value
|-
|-
| 3D object  
| 3D object  
| 0x00BCBCBC
| <code>0x00BCBCBC</code>
|-
|-
| Control background  
| Control background  
| 0x00FAFAFA
| <code>0x00FAFAFA</code>
|-
|-
| Indicator background  
| Indicator background  
| 0x00D2D2D2
| <code>0x00D2D2D2</code>
|-
|-
| 3D Active object  
| 3D Active object  
| 0x00969696
| <code>0x00969696</code>
|-
|-
| Text  
| Text  
| 0x00000000
| <code>0x00000000</code>
|-
|-
| Led On  
| Led On  
| 0x0064FF00
| <code>0x0064FF00</code>
|-
|-
| Led Off  
| Led Off  
| 0x001E4B00
| <code>0x001E4B00</code>
|-
|-
| Thermometer Fill  
| Thermometer Fill  
| 0x00FF0000
| <code>0x00FF0000</code>
|-
|-
| Slide Fill  
| Slide Fill  
| 0x000041DC
| <code>0x000041DC</code>
|-
|-
| Slide Housing  
| Slide Housing  
| 0x006D6D83
| <code>0x006D6D83</code>
|-
|-
| Tank Fill  
| Tank Fill  
| 0x000041DC
| <code>0x000041DC</code>
|-
|-
| Tank Housing  
| Tank Housing  
| 0x00A9B3CB
| <code>0x00A9B3CB</code>
|-
|-
| Classic Object  
| Classic Object  
| 0x00B3B3B3
| <code>0x00B3B3B3</code>
|-
|-
| Classic Slide Object  
| Classic Slide Object  
| 0x003399FF
| <code>0x003399FF</code>
|-
|-
| Refnum Wire  
| Refnum Wire  
| 0x00007F7F
| <code>0x00007F7F</code>
|}
|}


<br>
These color's are stored in the [[LabVIEW configuration file|LabVIEW configuration file]] with the token [[LabVIEW configuration file/Colors#colorUserItem|colorUserItem]]
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
<br>
 
These color's are stored in the [[LabVIEW configuration file|LabVIEW configuration file]] with the token [[LabVIEW configuration file/Colors#colorUserItem|colorUserItem]]<br>
 
<br>
 
<br>
 
[[Image:ColorDropDownUser.png]]<br>
 
== Adjustment<br>  ==


To adjust (or add) colors use the LabVIEW options Dialog. In LabVIEW 2009 the colors can be set in the ''Environment'' section.<br>
[[File:ColorDropDownUser.png]]


A special dialog is available for the 18 supported colors:<br>
== Adjustment  ==


[[Image:ColorAdjustUser.png]]<br>
To adjust (or add) colors use the LabVIEW options Dialog. In LabVIEW 2009 the colors can be set in the ''Environment'' section.


<br>
A special dialog is available for the 18 supported colors:


<br>
[[File:ColorAdjustUser.png]]


[[Category:Data types]]
[[Category:Data types]]

Revision as of 22:10, 15 November 2019

Colors are represented in LabVIEW by an unsigned 32-bit integer. The integer is of the hexadecimal form 0x00RRGGBB, where RR, GG, and BB represent the red, green, and blue components of the color, respectively.

Special cases

LabVIEW uses the upper byte (00) for special colors, normally this byte is used for transparency so using these color values in a different program might give odd results.

Transparent

Transparent has a color value 0x01000000 the last bit of the transparency byte is high, this can be used to create 'holes' controls:

System Background

This color turns the background into the background of the front-panel/block diagram. It's value is 0x01000037, special details: System_Label.

System Color

LabVIEW supports six system colors, they match on Windows different color types:

System color table
LabVIEW color name Windows color name LabVIEW color value
Panel and Object COLOR_3DFACE 0x01000016
Panel and Object text COLOR_BTNTEXT 0x01000006
Window COLOR_WINDOW 0x0100000A
Window text COLOR_WINDOWTEXT 0x0100000C
Highlight COLOR_HIGHLIGHT 0x01000008
Highlight text COLOR_HIGHLIGHTTEXT 0x01000009

There's a VI on ni.com that demonstrates all the LabVIEW system colors, which includes many more than can be selected from the color picker dialog: [1]

User colors

LabVIEW has additional colors that are used for specific elements, like the tank fill color, here's an overview of these colors and their LabVIEW color value, these are not stored with a special value, the following lists the default values for these colors. LabVIEW defines 15 colors per default, but has support for 3 additional colors.

LabVIEW color table
Default LabVIEW color name Default LabVIEW color value
3D object 0x00BCBCBC
Control background 0x00FAFAFA
Indicator background 0x00D2D2D2
3D Active object 0x00969696
Text 0x00000000
Led On 0x0064FF00
Led Off 0x001E4B00
Thermometer Fill 0x00FF0000
Slide Fill 0x000041DC
Slide Housing 0x006D6D83
Tank Fill 0x000041DC
Tank Housing 0x00A9B3CB
Classic Object 0x00B3B3B3
Classic Slide Object 0x003399FF
Refnum Wire 0x00007F7F

These color's are stored in the LabVIEW configuration file with the token colorUserItem

Adjustment

To adjust (or add) colors use the LabVIEW options Dialog. In LabVIEW 2009 the colors can be set in the Environment section.

A special dialog is available for the 18 supported colors: