Fixes wrong color averaging
Created by: 9600bauds
Here we have bour beakers, each containing milk, pepto-bismol, orange juice, and coffee. When we mix them in equal amounts, in the order listed (coffee last), the final mix looks like this: But when we mix them in the inverse order (milk last), the mix looks like this instead: None of those seem right. In the first one, the color is mostly that of coffee's, in the second, it's mostly white. What's going on here? Every time a reagent is introduced, the beaker's color is mixed 50-50% between it's old color and the new reagent's color. What this means is that the final color depends on the order the reagents were added in! No matter what order you use, it will never be the real average of colors. A way to visualize this problem is trying to mix buckets of paint. To mix green, red, and blue paint, you would mix one bucket of each. What the code does is mix the green bucket with the red bucket, but then since you have two buckets full of paint, it uses two buckets of blue paint to get a 50-50% mix (and if you then wanted to add black paint, it would use 4 buckets, and so on).
As you can see, my code makes you black as fuck.