I have to display a number whose color changes from Red to Green uniformly as the value of the number decreases.
Is there any way to generate the font color of that number according to the value ?
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.
Decreasing number equals red to green, I’d guess?
Why not make it simple, start out with your all red #FF0000, and work yourself down
to green at #00FF00?
Between the two there are FF*FF (256*256 = 65536) steps; adapt this to your needs and the JavaScript needed to get color should be simple.
ColorCalc – Nice tool for playing with/understanding hex v colors