Color

From LabVIEW Wiki
Jump to: navigation, search

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]:

ColorDropDownSystem.png

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

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

ColorDropDownUser.png

Custom user colors

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

ColorAdjustUser.png

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]:

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

References

  1. Control Transparency (LAVA)
  2. System Colors - Don't Believe Your Eyes (Eyes on VIs)
  3. 3.0 3.1 3.2 GetSysColor() (Microsoft Dev Center)
  4. Can I enable the Windows classic theme in Windows 10? (Microsoft Answers)
  5. 5.0 5.1 SetSysColor() (Microsoft Dev Center)
  6. Using System Colors (NI Example Programs)
  7. "Secret" LabVIEW System Colors (Vision Technologies)