Jump to content

Color: Difference between revisions

From LabVIEW Wiki
Complete description for environment colors
Line 388: Line 388:
|-
|-
| <code>0x01000038</code>
| <code>0x01000038</code>
| <div style="display: block; background-color: #9984D1; padding: 10px;" />
| <div style="display: block; background-color: #99B4D1; padding: 10px;" />
| '''Title Bar Active''': Title Bar active color.
| '''Title Bar Active''': Title Bar active color.
|-
|-

Revision as of 09:13, 16 November 2019

LabVIEW represents colors as unsigned 32-bit integers in the form 0x00RRGGBB, where RR, GG, and BB represent the red, green, and blue color components, respectively. The upper byte (00) is reserved for special colors like Transparent and System colors in which the least significant bit is set to 1.

Transparency

The "transparent" color has the value 0x01000000. Elements with this color appear fully transparent.

It is not possible to set a semi-transparent color to individual elements in LabVIEW[1].

System Colors

LabVIEW provides six system colors that change depending on the selected color theme of the Operating System[2]:

Name Value
LabVIEW Windows[3] LabVIEW Windows[3]
Panel & Object COLOR_BTNFACE (15) 0x01000016 0x00F0F0F0
Panel & Object Text COLOR_BTNTEXT (18) 0x01000006 0x00000000
Window COLOR_WINDOW (5) 0x0100000A 0x00FFFFFF
Window Text COLOR_WINDOWTEXT (8) 0x0100000C 0x00000000
Highlight COLOR_HIGHLIGHT (13) 0x01000008 0x000078D7
Highlight Text COLOR_HIGHLIGHTTEXT (14) 0x01000009 0x00FFFFFF

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]

Change system colors on Windows 10

Windows 10 has no built-in dialog to change system colors[4]. The color values, however, can still be modified directly in the Registry under HKEY_CURRENT_USER\Control Panel\Colors (requires reboot) or via SetSysColor[5] (doesn't require reboot).

Reads a system color using GetSysColor[3]
Sets a system color using SetSysColor[5]

User colors

LabVIEW provides slots for up to 18 user colors that can be set to custom values. By default, 15 colors are pre-defined.

Name 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

Custom user colors

User colors can be set in the options dialog under Tools > Options... > Environment > Custom Colors...:

Environment colors

When the least significant bit of the upper byte is set to 1, LabVIEW returns environment colors. For example transparent (0x01000000). These environment colors are mostly undocumented. However, some resources are available[6][7] which list following colors:

Color Value Description
0x01000000
Transparent
0x01000001 --- Most Recent Color: Represents whichever color was selected most recently.
0x01000002 --- Bad Color: Represents an invalid color.
0x01000003
Window Frame (System): Represents the system color for COLOR_WINDOWFRAME (6)
0x01000004
BtnHiLight (System): Represents the system color for COLOR_BTNHILIGHT (20)
0x01000005
BtnShadow (System): Represents the system color for COLOR_BTNSHADOW (16)
0x01000006
BtnText (System): Represents the system color for COLOR_BTNTEXT (18)
0x01000007
GrayText (System): Represents the system color for COLOR_GRAYTEXT (17)
0x01000008
HiLight (System): Represents the system color for COLOR_HIGHLIGHT (13)
0x01000009
HiLightText (System): Represents the system color for COLOR_HIGHLIGHTTEXT (14)
0x0100000A
Window (System): Represents the system color for COLOR_WINDOW (5)
0x0100000B
MsgBox: Represents the color for message boxes.
0x0100000C
WindowText (System): Represents the system color for COLOR_WINDOWTEXT (8)
0x0100000D
ScrollArrow: Arrow color on the scrollbar.
0x0100000E
ScrollArrowT: Arrow color on the scrollbar when pressed.
0x0100000F
ScrollBtn: Color for the scrollbar button.
0x01000010
ScrollBtnT: Color for the scrollbar button when pressed.
0x01000011
ListBoxContent: List Box background color.
0x01000012
ListBoxText: List Box text color.
0x01000013
ListHilite: List Box highlight color.
0x01000014
EditTextBg: Edit text background color.
0x01000015
BtnFaceOff: Button face color when off.
0x01000016
BtnFaceOn: Button face color when on.
0x01000017
BtnFaceOffT: Button face color when off and pressed.
0x01000018
BtnFaceOnT: Button face color when on and pressed.
0x01000019
BtnTextOff: Button text color when off.
0x0100001A
BtnTextOn: Button text color when on.
0x0100001B
BtnTextOffT: Button text color when off and pressed.
0x0100001C
BtnTextOnT: Button text color when on and pressed.
0x0100001D
BevelBtnFaceOff: Beveled button face color when off.
0x0100001E
BevelBtnFaceOn: Beveled button face color when on.
0x0100001F
BevelBtnFaceOffT: Beveled button face color when off and pressed.
0x01000020
BevelBtnFaceOnT: Beveled button face color when on and pressed.
0x01000021
BevelBtnHilite: Beveled button highlight color.
0x01000022
BevelBtnShadow: Beveled button shadow color.
0x01000023
BevelBtnTextOff: Beveled button text color when off.
0x01000024
BevelBtnTextOn: Beveled button text color when on.
0x01000025
BevelBtnTextOffT: Beveled button text color when off and pressed.
0x01000026
BevelBtnTextOnT: Beveled button text color when on and pressed.
0x01000027
RingBtnTextOff: Ring button text color when off.
0x01000028
RingBtnTextOn: Ring button text color when on.
0x01000029
RingBtnTextOffT: Ring button text color when off and pressed.
0x0100002A
RingBtnTextOnT: Ring button text color when on and pressed.
0x0100002B
TipStripBG: Tip strip background color.
0x0100002C
TipStripText: Tip strip text color.
0x0100002D
MenuFG: Menu foreground color.
0x0100002E
MenuBG: Menu background color.
0x0100002F
MenuBarFG: Menu bar foreground color.
0x01000030
MenuBarBG: Menu bar background color.
0x01000031
ScrollBarFG: Scroll Bar foreground color.
0x01000032
ScrollBarBG: Scroll Bar background color.
0x01000033
TabHidden: Tab hidden color.
0x01000034
TabNorm: Tab normal color.
0x01000035
3DDarkShadow: 3D Dark Shadow color.
0x01000036
3DLight: 3D Light color.
0x01000037 --- SystemOwner: Represents the color of the owning container.
0x01000038
Title Bar Active: Title Bar active color.
0x01000039
Title Bar Inactive: Title Bar inactive color.
0x0100003A
Title Bar Text Active: Title Bar text color when active.
0x0100003B
Title Bar Text Inactive: Title Bar text color when inactive.
0x0100003C
Radio Button Text: Radio Button text color.
0x0100003D
Checkbox Text: Check Box text color.

References