I would like to come up with as many HEX HTML values to have a smooth color gradient from red to green:
I would like this to be similar to the following: http://ww
I used this in a php page:
$percent = .....; //whatever the percentage you want to colour
If ($percent <= 50) {
$red = 255;
$green = $percent * 5.1;
}
If ($percent >= 50) {
$green = 255;
$red = 255 - ($percent - 50) * 5.1;
}
$blue = 0;
Your RGB is then ($red, $green, $blue)
Note: The 5.1 factor dervies from 255/50