Hello.
I am sorting through some data that results in two pairs of True False responses. I’m trying to now color code the results (as shown in the attached image with the unconnected swatches) so that the four resulting options each have a separate color.
You can do this in a quite elegant way, by thinking of your two values as two positions in a binary bit flag. so:
False,False = 00 in binary = 0 in decimal
False,True = 01 in binary = 1 in decimal
True,False = 10 in binary = 2 in decimal
True,True = 11 in binary = 3 in decimal
We can calculate the decimal value by multiplying the first boolean by 2 and adding it to the second.
(True,True = 1,1 => 1*2 + 1 = 3)
Then we can order our list of colors such that their indices match the desired binary combination: