Change the Background Color of LabVIEW Block Diagrams

Updated Oct 26, 2023

Environment

Software

  • LabVIEW

I want to change the background color of the block diagram of my current VI or all future VIs I create, for aesthetic or usability purposes. How do I accomplish this?

There are two approaches to this problem. You can change the default background color for all future VIs made with a particular LabVIEW development environment, and you can edit the background color of an existing block diagram.
 

Future VIs:

The setting for block diagram background color is located in the LabVIEW Options.
  1. In LabVIEW, navigate to Tools»Options..., and under Category, choose Environment.
  2. Scroll down to the section titled Colors. Uncheck the box labeled Use default colors.
  3. Now you can choose the colors that new VIs use. To change the background color for the block diagram, click on the colored box labeled Block Diagram, and choose the desired color. Select OK to save options
  4. To test, open a new VI from File >> New VI. The new VI's block diagram should be the color specified in the previous steps.

Note that this does not affect VIs that you have already created. These options under the Environment category are shown here:

 

Existing VIs:

There are two ways to change the block diagram of Existing VIs. You can accomplish this manually or programmatically.

Manually Change Block Diagram Background Color:

  1. To accomplish this manually for your open VI, open the Tools Palette from the View menu 
  2. Choose the Coloring tool as seen in image below.
  3. Right-click on the block diagram background and the coloring palette selector will appear.  Select your desired color by left-clicking within the color selector.


 

Programmatically Change Block Diagram Background Color:

To accomplish this programmatically, there is a block diagram property that can be edited to change the background color of an existing VI. 

  1. Enable VI Scripting in LabVIEW.
    1. To do this, navigate to Tools»Options..., and under Category, choose VI Server.
    2. Check the box labeled Show VI Scripting functions, properties and methods. Choose OK to save the change.
  2. In your LabVIEW code, obtain a reference to the VI you want to edit. If you want to edit the VI you are writing the code in, you can use the default value for the VI Server Reference located in the Functions palette under Programming»Application Control.
  3. Add a Property Node and wire in the VI reference. Choose the property Block Diagram. This outputs a reference to the block diagram itself.
    1. If you do not see Block Diagram in the list of available properties, go back to step 1 and ensure VI Scripting is enabled.
  4. Add another Property Node and wire in the block diagram reference.  Choose the property Color.
    1. If the property is currently readable, right-click the property and select Change to Write.
  5. Obtain a Color Box Constant from the Functions palette by navigating to Programming»Dialog & User Interface. Wire the Color Box Constant to the Color property.
    • The input for the Color property is a numeric integer representing a color, and the Color Box Constant makes it easier to choose the color that represents a given numeric integer.
  6. Left-click on the Color Box Constant and choose the desired color.
  7. Run the VI that this code is in, and the block diagram background color for the VI you reference will change. 
The snippet below is the outcome of the steps described above.

 Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.

Additional Information

  • Editing the color in LabVIEW Options adds the diagram. background token to the LabVIEW INI file (located in the same folder as LabVIEW.exe). The value for the token is 00 followed by the hex triplet color code representing the chosen color. For a white background, the token appears as follows: 
    • diagram. background=00FFFFFF