Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Building a Color Box with RGB Components Using LabVIEW

Overview

This VI allows the user to build a Color Box with RGB Components

 

Description

This VI shows the inner working of a color box. We normally place a color box control and forget about it, but this VI shows how to build A Color Box programmatically using RGB components. A color box is a U32 number, with four 8-bit planes. The planes are red, green, blue, and Alpha. The Alpha bit is normally zero for a typical color. However, it is used as ’1’ if the user wants the color to be transparent.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

1. Run the VI
2. Modify the Green, Red and Blue Controls
3. Press Alpha, if you want the Color Box to be transparent

 

Additional Information or ReferencesColor Box Control LV2012 NI Verified BD.png

 

 

 

 

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Chris Van Horn
Applications Engineer
Comments
Member seeker169
Member

In the 2012 version, there needs to be a "To U8" after the "Boolean to (0,1)" function for the transparancy part of this to work.

Member carlos_camargo
Member

I think this is a nice simple little tool for generating colors, I found it useful for my needs in figuring out how to dim an LED.  As seeker169 pointed out, the "To U8" is necessary for transparency to work but it is also needed for the Red aspect to contribute.  I changed the 2012 vi to incorporate the change recommended by seeker169.