Calculating Color Range

  • Thread starter Thread starter simchajoy2000
  • Start date Start date
S

simchajoy2000

Hi,

I need to calculate a range of colors given the beginning and ending
colors in hex values (i.e. blue to red). I know there is a logic to
hex numbers and there is probably a fairly simple way to increment
from one color to the next - but I have no idea what it is. Does
anyone know how to do this? Any suggestions greatly appreciated!!

Thanks!

Joy
 
Hi,

I need to calculate a range of colors given the beginning and ending
colors in hex values (i.e. blue to red). I know there is a logic to
hex numbers and there is probably a fairly simple way to increment
from one color to the next - but I have no idea what it is. Does
anyone know how to do this? Any suggestions greatly appreciated!!

Thanks!

Joy

Are you doing this for painting? If so you might look at the gradient
brushes which do this automatically.

As far as colors go, the following site might be a good read:

http://www.web-colors-explained.com/

Thanks,

Seth Rowe
 
Are you doing this for painting? If so you might look at the gradient
brushes which do this automatically.

As far as colors go, the following site might be a good read:

http://www.web-colors-explained.com/

Thanks,

Seth Rowe

Actually, I just have a VB.NET form where a user can specify a color
range and a range of values associated with it. They can also specify
the increment, so for example: the color range is blue - red, the
value range is 1 - 1,000 and the increment is 50. I will divide 1,000
by 50 to get the number of individual ranges - for each range I need a
color that falls within the range of blue - red. The only way I can
figure out how to do this is to use the hex values and somehow
increment them to get a color for each range. Does that make sense?

Thanks for your help!

Joy
 
I need to calculate a range of colors given the beginning and ending
colors in hex values (i.e. blue to red). I know there is a logic to
hex numbers and there is probably a fairly simple way to increment
from one color to the next - but I have no idea what it is. Does
anyone know how to do this? Any suggestions greatly appreciated!!

You'll find it easier to get the range of colours in HSB colour space, where
you simply vary the hue across the desired range, then convert back to RGB.

http://en.wikipedia.org/wiki/HSV_color_space

Andrew
 
Thank you! That's a great idea. Just for clarification though - HSB
is the same as HSV correct?

Yes: HSB=hue, saturation, brightness; HSV=hue, saturation, value.
And do you know of any VB.NET example
code that works with HSB?

Google for
vb.net (hsv OR hsb)

Andrew
 
Back
Top