Gradiant coloring

J

Joe

Hey all!

I need to color from blue to red in sort of a gradient depending on a value.

For example: lets say 1 is blue and red is 100. I need to change from blue
to red depending on the value so 50 would be a color in between blue and red
and 25 would be more blue than red.

Does anyone have an algorithm to do this?

Thanks.
Joe
 
R

rowe_newsgroups

Hey all!

I need to color from blue to red in sort of a gradient depending on a value.

For example: lets say 1 is blue and red is 100. I need to change from blue
to red depending on the value so 50 would be a color in between blue and red
and 25 would be more blue than red.

Does anyone have an algorithm to do this?

Thanks.
Joe

Can't you just use the GradientBrush in the System.Drawing namespace?

Thanks,

Seth Rowe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top