Calculating Color Range

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
 
R

rowe_newsgroups

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
 
S

simchajoy2000

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
 
A

Andrew Morton

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
 
S

simchajoy2000

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? And do you know of any VB.NET example
code that works with HSB?

Joy
 
A

Andrew Morton

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
 

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