I made the exact same effect in my RC biplane. I originally tried to find a script that could make it change HSV to RGB from red to green, then use this to change it to Hex, but I ended up making my own little function to change the colors which ended up being much easier.
%a is 1 - %target.getDamagePercent();.
function greenToRed(%a)
{
%r = 1;
%g = 1;
if(%a >= (1/2))
{
%r = mAbs(%a - 1) * 2;
}
if(%a < (1/2))
{
%g = %a * 2;
}
return %r SPC %g SPC "0";
}
You just have to plug that into Port's function and it should give it to you in RGB Hex.