It would, but not always. There are approaches to always drawing two different color.
I thought of one with rep_ncr_combinations_index2list command, rep_permutation_index2list command, and using map(). Basically, I select 2 colors from a image with ncr_combinations, and change their order with permutation.
There’s other method like keeping in track of what selected and increment until a not-selected index has been found. This is the best way of doing this.
Finally, have a look at this:
foo 8,2
foo:
number_of_colors=$1
selected_colors=$2
+rep_ncr_combinations $number_of_colors,$selected_colors,x
+rep_permutations $selected_colors,x
resize[-2] {w*100}%,100%,100%,100%,1
f[-2] map(I[#-1,x%w#-1],I) rm.
foo 8,2 outputs every possibilities of 2 randomly selected colors out of 8 colors without repeat. This gives us:
(0,1,0,2,0,3,0,4,0,5,0,6,0,7,1,2,1,3,1,4,1,5,1,6,1,7,2,3,2,4,2,5,2,6,2,7,3,4,3,5,3,6,3,7,4,5,4,6,4,7,5,6,5,7,6,7^1,0,2,0,3,0,4,0,5,0,6,0,7,0,2,1,3,1,4,1,5,1,6,1,7,1,3,2,4,2,5,2,6,2,7,2,4,3,5,3,6,3,7,3,5,4,6,4,7,4,6,5,7,5,7,6)
Each pixels represent the colors selected.