Wiggle the mouse around. See what is happening? 99/100 is still 0 in integer division.
However, we can make either of those a floating point number, then division will give you a value between 0.0 and 1.0, which is what you want. So, you could write any one of these lines:
float amt = (float)mouseX/width;
float amt = float(mouseX)/width;
float amt = mouseX/float(width);
float amt = mouseX/(float)width;
float amt = mouseX * 1.0/width;
float amt = mouseX/(1.0 * width);
…and any of those lines would work with:
color newBackColor = lerpColor(fromColor, toColor, amt);