I am wanting to make a progress-bar-type-thing which goes from green-orange-red as it moves across the screen. For example:

How can I find what the colour should be at a given point?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Edit: here’s a link to a jsfiddle implementing this: http://jsfiddle.net/EAM9a/
For the simplest method, you can do a linear interpolation between the colors. Let’s assume that the progress goes from 0.0 to 1.0 to make things easy. So
Then we can just interpolate between green and orange or between orange and red, depending on the color we want.