I’m wondering if it is possible to make a machine that outputs blues as 0s and reds as 1s corresponding to a bit.
This is for 1 bit
If you mean that you set bits and the colors of the balls output correspond to the bit settings, then see this solution for a 4-bit output machine: Representation of a 4-bit binary number - #3 by lennypitt