I think this would be better as a percentage instead of a 0-255 int. How about ((replaceColor >> 24) & 0xFF) / 255f.
That way you can simplify... (see below)