Color: Difference between revisions
→System Color: Oops, I had two of the colors wrong. |
No edit summary |
||
Line 17: | Line 17: | ||
== System Color<br> == | == 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:<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:<br> | ||
{| width="600" cellspacing="1" cellpadding="1" border="1" align="left" | {| width="600" cellspacing="1" cellpadding="1" border="1" align="left" | ||
|+ System color table | |+ System color table | ||
|- | |- | ||
! scope="col" | LabVIEW color name<br> | ! scope="col" | LabVIEW color name<br> | ||
! scope="col" | Windows color name<br> | ! scope="col" | Windows color name<br> | ||
! scope="col" | LabVIEW color value<br> | ! scope="col" | LabVIEW color value<br> | ||
|- | |- | ||
| Panel and Object<br> | | Panel and Object<br> | ||
| COLOR_3DFACE<br> | | COLOR_3DFACE<br> | ||
| 0x01000016<br> | | 0x01000016<br> | ||
|- | |- | ||
| Panel and Object text<br> | | Panel and Object text<br> | ||
| COLOR_BTNTEXT<br> | | COLOR_BTNTEXT<br> | ||
| 0x01000006<br> | | 0x01000006<br> | ||
|- | |- | ||
| Window<br> | | Window<br> | ||
| COLOR_WINDOW<br> | | COLOR_WINDOW<br> | ||
| 0x0100000A<br> | | 0x0100000A<br> | ||
|- | |- | ||
| Window text<br> | | Window text<br> | ||
| COLOR_WINDOWTEXT<br> | | COLOR_WINDOWTEXT<br> | ||
| 0x0100000C<br> | | 0x0100000C<br> | ||
|- | |- | ||
| Highlight<br> | | Highlight<br> | ||
| COLOR_HIGHLIGHT<br> | | COLOR_HIGHLIGHT<br> | ||
| 0x01000008<br> | | 0x01000008<br> | ||
|- | |- | ||
| Highlight text<br> | | Highlight text<br> | ||
| COLOR_HIGHLIGHTTEXT<br> | | COLOR_HIGHLIGHTTEXT<br> | ||
| 0x01000009<br> | | 0x01000009<br> | ||
|} | |} | ||
<br> | <br> | ||
<br><br> | <br><br> | ||
<br> | <br> | ||
<br> | |||
<br> | |||
<br> | <br> | ||
<br> | <br> | ||
<br> | <br> | ||
<br> | [[Image:ColorDropDownSystem.png]]<br> | ||
<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] | ||
= User colors = | = User colors = | ||
Line 173: | Line 177: | ||
<br> | <br> | ||
<br> | <br> | ||
[[Category: | [[Category:Data types]] |
Revision as of 02:38, 5 May 2010
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:
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.
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: