I'm confused, what is the problem? You need to do a linear interpolation on each channel.
I guess you can use the vector functions to make it more efficient:
function interpolateColor(%col1, %col2, %d)
{
//get alpha
%alpha1 = getWord(%col1, 3);
%alpha2 = getWord(%col2, 3);
//get new color
return vectorAdd(%col1, vectorScale(vectorSub(%col2, %coil1), %d)) SPC
%alpha1 + (%alpha2 - %alpha1) * %d;
}