LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with color

How we can generate different shades of single color
From dark to light .using a control like dial
If dial pointing on zero we get darkest shad ,
If dial is pointing to maximum we should get lightest shad
I want to assign this shad to the color property of LED.
0 Kudos
Message 1 of 8
(3,347 Views)
> How we can generate different shades of single color
> From dark to light .using a control like dial
> If dial pointing on zero we get darkest shad ,
> If dial is pointing to maximum we should get lightest shad
> I want to assign this shad to the color property of LED.

There are many ways to do color interpolation. The quick way is to do
it in the RGB colorspace. If You might try using the hilite color.vi
located in the picture control palette. It takes a given color and
returns the colors mixed with white and black. If you want a smooth
ramp, it would be more efficient to determine the first color and last
and you can linearly interpolate between the R, G, and B coordinates
independently. Another way is to start at your color and linearly mo
ve
to white by linearly interpolating the R, G, and B values independently.
Then do the same towards black.

If I'm misunderstanding your question, please post more details.

Greg McKaskle
0 Kudos
Message 2 of 8
(3,347 Views)
Hi thanks for your ans.
I had use color to RGB vi, and find it's RGB component
I am more interested in starting with a color and move it towards black or white
I was unable to do it.
can you tell how to achieve it, Can I use color ramp for this
If yes then how to use it.
if possible send example vi
Please help.
0 Kudos
Message 3 of 8
(3,347 Views)
> I had use color to RGB vi, and find it's RGB component
> I am more interested in starting with a color and move it towards
> black or white
> I was unable to do it.
> can you tell how to achieve it, Can I use color ramp for this
> If yes then how to use it.
> if possible send example vi

As I said, there is a VI in the picture palette, near the Color to RGB
that returns the hilite and shadow of a color. You can repeatedly call
this VI passing in a percentage, or you can look at its diagram.

Greg McKaskle
0 Kudos
Message 4 of 8
(3,347 Views)
Hello,

Attached is an example of how you can do this with the Hilite Color.vi that Greg has mentioned. I have used this VI in a case structure so that you smoothly see the color transition from white to black by moving a knob on the front panel. I hope this helps!

Regards,
Jyoti F.
National Instruments
0 Kudos
Message 5 of 8
(3,347 Views)
yesterday evening i solved my problem ,
my internet connection was down
so couldn't reply you.

I manage to find vi.

how can i assigned the shads i get to the LED as it's color
because LED take array as input to it's color property

thanks for reply
0 Kudos
Message 6 of 8
(3,347 Views)
thanks for ans.
0 Kudos
Message 7 of 8
(3,347 Views)
The array is up to 4 (FG color, BG color) pairs. Color pairs include False, True, True to False, and False to True. Each pair is a cluster of two colors. You can then make an array of up to 4 clusters that refer to the four cases listed above.

Hope this helps!

AllenP
Applications Engineer
National Instruments
0 Kudos
Message 8 of 8
(3,347 Views)