473,320 Members | 1,945 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,320 software developers and data experts.

color question

I want to shade the back ground of a series of table cells.
based on a series of integers
0 =white
100=greem
-100 =red
there are values inbetween and i want to go red to white as the numbers get
close to 0 and from 0 to 100 it goes from white to green
any one do something like this?

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
Feb 15 '07 #1
4 952
On Feb 15, 11:37 pm, WebBuilder451
<WebBuilder...@discussions.microsoft.comwrote:
I want to shade the back ground of a series of table cells.
based on a series of integers
0 =white
100=greem
-100 =red
there are values inbetween and i want to go red to white as the numbers get
close to 0 and from 0 to 100 it goes from white to green
any one do something like this?
The question is how do you want to do that. By giving the background a
gradient using CSS, or by giving a fixed RGB value?

Feb 15 '07 #2
for this situation fixed rgb
--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Alexey Smirnov" wrote:
On Feb 15, 11:37 pm, WebBuilder451
<WebBuilder...@discussions.microsoft.comwrote:
I want to shade the back ground of a series of table cells.
based on a series of integers
0 =white
100=greem
-100 =red
there are values inbetween and i want to go red to white as the numbers get
close to 0 and from 0 to 100 it goes from white to green
any one do something like this?

The question is how do you want to do that. By giving the background a
gradient using CSS, or by giving a fixed RGB value?

Feb 15 '07 #3
On Feb 16, 12:04 am, WebBuilder451
<WebBuilder...@discussions.microsoft.comwrote:
for this situation fixed rgb
if v is your value (-100..100)

if (v<0) {
x=255 - v*(-2.55);
color = rgb(255,x,x);
} else {
x=255 - v*2.55;
color = rgb(x,255,x);
}

Feb 15 '07 #4
thanks that was exactly what i needed!

--
thanks (as always)
some day i''m gona pay this forum back for all the help i''m getting
kes
"Alexey Smirnov" wrote:
On Feb 16, 12:04 am, WebBuilder451
<WebBuilder...@discussions.microsoft.comwrote:
for this situation fixed rgb

if v is your value (-100..100)

if (v<0) {
x=255 - v*(-2.55);
color = rgb(255,x,x);
} else {
x=255 - v*2.55;
color = rgb(x,255,x);
}

Feb 16 '07 #5

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

Similar topics

1
by: Jim M M | last post by:
Hello Everyone, QUESTION #1 I am working on a timer. I have the following code which works kind of OK. If Form1.WindowState = 1 Then Form1.WindowState = 0 The problem is that if the user...
14
by: mr_burns | last post by:
hi, i am tryin to alter the color of my scroll bars on a site i am workin on. the site is oarsome.martynbissett.co.uk, to access the css style sheet, type in...
19
by: Vinod | last post by:
Hi, I have got a peculiar requirement. I want to distinquish between the color codes. I have got two text fields and i will enter the color codes there. The first text field will have ...
11
by: Yeah | last post by:
I have a multiple choice quiz where I would like to use CSS to change the color of the answers upon clicking them. I would like to present the right and wrong answers up front, rather than direct...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
4
by: Sami | last post by:
Hello, I just started out with Windows.Forms and was going through the MS tutorials. In the tutorial where you can create a non-rectangular shaped window by using your own window painted with...
1
by: Patrick.O.Ige | last post by:
Any ideas how to have users select different color for a website in ASP.NET? Any artticles would be appreciated!
8
by: Chad | last post by:
Should links automatically appear in the "visited" color as defined by the user's IE settings without having to add any special coding? I have a situation where the link was not changing color...
2
by: Eric | last post by:
When i bound the other form in my main form. The whole first subform area is covered with white color. But when i bound another form its not shows the whole area in white color. Why my one subform...
6
by: AAaron123 | last post by:
I'm using the CreateUserWizard Web Server Control The error message when the passwords do not match is colored red. Red does not show well against my background so I like to change that color. I...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.