Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Color Ramp Generator

Contestant Info:

David Thomson

Original Code Consulting

User Group Affiliation:  ALARM  (Advanced LabVIEW Architects of the Rocky Mountains)

Summary:

Some time ago, I was looking for a way to create a color ramp for an XControl graph I was making.  I needed a way to deal with the color ramp in more detail than the ramps that are already parts of some controls.  I found the guts of this in an NI example and put together a small demo program.

Function:

The Choose Color Ramp.vi is a top-level program that can be run interactively to allow the user to define a color ramp suitable for his/her purpose.  Run the VI, then change the number of colors, choose whether or not to pin the middle of the ramp to a third color (or just define it with two end-points), and choose each color.  An example of the color ramp is shown below.  If Apply is pressed, the information needed to generate that color ramp is sent out a cluster.

Steps to execute code:

  1. Open "Choose Color Ramp.vi".

  2. Press the run button.

  3. Play with the various controls to arrive at a color ramp that works for your situation.

  4. Press Apply to finish and send the color ramp definition out through a cluster.

Screenshots:

Main Front Panel:Color_Ramp_FP.jpg

Main Block Diagram:Color_Ramp_BD.jpg

VI attached below

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
Comments
G-Money
NI Employee (retired)
on

Nice! Could you add some documentation to your subVIs? It's kinda hard to follow what your logic is doing and why. This way others can see and read how the math works to creating the color ramp. Thanks!

Contributors