Example Code

Color Mixing in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Use this VI to create a color with R G B parameters

 

Description

This VI will mix different amounts of Red, Green and Blue to generate the color in the color box. This is done by taking three 8-bit unsigned numeric inputs, converting them to boolean arrays, combining the arrays and converting the resultant boolean array to a 32-bit unsigned integer.

 

Requirements

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

1. Run VI
2. Select values for each of the color components (Blue, Green, and Red) between 0 and 255
3. The color box displays the resulting color mix

 

Additional Information or References
Block Diagram

RGB Mix LV2012 NI verified.png

 

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

Regards,
Dan King

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.