473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calculating Color Range

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

May 10 '07 #1
5 4215
On May 10, 1:32 pm, "simchajoy2...@yahoo.com"
<simchajoy2...@yahoo.comwrote:
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

May 10 '07 #2
On May 10, 11:36 am, rowe_newsgroups <rowe_em...@yahoo.comwrote:
On May 10, 1:32 pm, "simchajoy2...@yahoo.com"

<simchajoy2...@yahoo.comwrote:
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
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

May 10 '07 #3
si***********@yahoo.com wrote:
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
May 11 '07 #4
On May 11, 1:32 am, "Andrew Morton" <a...@in-press.co.uk.invalid>
wrote:
simchajoy2...@yahoo.com wrote:
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? And do you know of any VB.NET example
code that works with HSB?

Joy

May 11 '07 #5
si***********@yahoo.com wrote:
On May 11, 1:32 am, "Andrew Morton" <a...@in-press.co.uk.invalid>
wrote:
>simchajoy2...@yahoo.com wrote:
>>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
May 14 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Ron Adam | last post by:
Hi, I'm having fun learning Python and want to say thanks to everyone here for a great programming language. Below is my first Python program (not my first program) and I'd apreciate any...
5
by: Mr. Ken | last post by:
I am calculating the phase of an IQ signal, which are polluted by AWGN gaussian noise. Thus, near pi/2, direct division of atan(Q/I) may yield outputs either +pi/2 or -pi/2. How do I handle this...
2
by: Carl | last post by:
Hi, I have a query that produces an output similar to the sample shown below. These records are based on certain criteria and a date range selected from a form. I need to create some kind of...
38
by: jdcrief | last post by:
Complier: Visual C++ 2005 Express Edition The program I wrote will compile and execute, but the output is always the same, no matter what number is entered in for the radius of the circle. ...
1
by: josecruz | last post by:
I have created a main report, which is controlled with a date range parameter from the main form. The report has several sub reports, which perform calculations (counts and averages at the subreport...
22
by: dos.fishing | last post by:
Hello, I'm writing a function that should do the following: /** * Calculate and return fraction of valueA where max fractions is 31. * param valueA A five bit value, 0-31. * param valueB The...
25
by: Umesh | last post by:
i want to calculate the time required to execute a program. Also i want to calcute the time remaining for the execution of the program. how can i do that? pl mention some good websites for...
1
by: Del | last post by:
I have a parameter query that requires the user to enter a Start Date: and End Date: and pull data between that date range. I am currently using the following parameter; Select * From mytable...
3
Claus Mygind
by: Claus Mygind | last post by:
My date calculation do not seem to work out. I have a list box with a character string value of dates ie: 03/28/2009. I want to create a date range for the week. So I would like to get the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.