With picking by comparison you can pick only the black pieces.
Once you have picked all the black pieces, just set their frame to a random frame that is not black, so if frame 0 is black and frame 1 till 6 are some colors,
pick block where block.animationframe = 0: set animation frame = floor(random(1,7))