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

Gradiant coloring

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
Aug 30 '07 #1
2 1156
On Aug 30, 11:06 am, "Joe" <jbassk...@noemail.noemailwrote:
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

Aug 30 '07 #2
Joe
Never mind. This is very simple. I just change the B & R.

"Joe" <jb*******@noemail.noemailwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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

Aug 30 '07 #3

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

Similar topics

7
by: Ruthless | last post by:
hello. I've got a simple question. I've searched on google for PHP scripts coloring syntax e.g. asm, c, c++, bash etc. I've only found some CGI, apps, modules for Apache - but i can't use...
2
by: Ron Brennan | last post by:
Good afternoon. The entire task that I'm trying to achieve is to allow a user to browse and upload multiple files simultaneously, hiding the Browse button of <input> tags of type="file" and...
5
by: Sami Viitanen | last post by:
Hello, Is there an easy way to make script print text with differents colors to screen (shell)? I mean a script that can for example print lines in red if some error occurs in executing some...
1
by: Afanasiy | last post by:
What's the best method for coloring simple markup? <xyz att="val" att="val"> You can assume it is not HTML or XML or valid anything except markup which happens to look somewhat like them. ...
2
by: Larry Werner | last post by:
We have source files with extension ".pc", which we would like to be treated by the text editor as if they are ".cpp" files for the purpose of syntax coloring. In Visual C++ 6.0 we could do that...
0
by: Markk | last post by:
Hi. I would like to ask If somebody don't have any small sample to coloring XML syntax, e.g. in RichTextBox. It can be in VB.NET or C#. I watched on SharpDevelop, but I could not understand...
2
by: Dan | last post by:
I'd like to show some XML text into an (editable) text box with some syntax coloring for tags, attributes etc. I don't need a full-blown commercial control, I'd just like to do some coloring on...
5
by: Wilfried Mestdagh | last post by:
Hello, I wants to set the background color of rows in a datagridView based on the value of a particular cell. Someone knows how to do this ? -- rgds, Wilfried http://www.mestdagh.biz
7
by: braver | last post by:
Greetings -- as a long time user of both Python and Ruby interpreters, I got used to the latter's syntax-coloring gem, wirble, which colorizes Ruby syntax on the fly. Is there anything similar for...
3
by: sandromani | last post by:
Hi all, I am writing a webbased notepad and want to include syntax-coloring. The approach I have used is to set the font color and background color of the textarea to transparent, and place the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.