Example Code

Changing Colors Depending on Percentage Input 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

This VI exemplifies how to create different color combinations by the use of "RGB: to Color VI.

 

Description

This VI will change the output color of the color box depending on the percentage of the numeric slide bar control. The bar is divided into 3 sections, which also corresponds to a case inside a case structure.


The program then uses the RGB to color VI which takes values for red, green, and blue and converts them into
a color.

 

Requirements
LabVIEW Base Development System.

 

Steps to Implement or Execute Code
1. Open the attached VI "Generate Color from a Slider LV 2012 - NI Verified.vi".
2. Run the VI.

 

Additional Information or References

 Snippet 2177.png

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

Chris Van Horn
Applications Engineer

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

Comments
alexlampo
Member
Member
on

What if you want to invert the start and end color? for example to start from red and end to blue.

Thanks!