Assuming values are normalized from 0 to 1, what is the algoritm to get a color to create a heatmap like this?
1 is red, .5 is green, 0 is dark blue.
Working in RMagick / ImageMagick.

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.
I found this surprisingly easy to do with HSL.
In Ruby:
This method returns HSL values as a string between 0% and 100%. It can be used with RMagick or ImageMagick.
Reference: ImageMagick HSL documentation.
In Java, for CSS, tested:
Note the key difference between CSS and ImageMagick: the first value is 0-360 and without a percent sign.