When using percentages, try to convert it back into percentages. Meaning, if you have 117%, you would take 117/100 = 0.8547 So your 100% should now be 84.5% blue, and 15.5% red (100-85.5)
That should provide you with the correct logic.