Sorry, I'd been mucking about with it before I posted it. 'mod' should be replaced by 'math.modf' for it to work as intended!
Lua Code:
local GetPercentageColourGradient = function(percent)
local _, x = math.modf(percent * 0.02);
return (percent <= 50) and 1 or (percent >= 100) and 0 or (1 - x), (percent >= 50) and 1 or (percent <= 0) and 0 or x, 0;
end
Aanson