Not exactly random. If you mess around with RGB values of any image editing software, you're likely to notice that you get the same result as you see up here. This is also explained by the blocks being composed of the 3 components red, green and blue, rather than conforming to "realism".
If more realism were to be applied, you'd never end up with white (which is more or less the objective). I'm aware that it is a bit unintuitive, and made this picture to help it a bit. Playing the game for a little while is also likely to make you remember what colours to combine.