Enable turbo mode. I just tried fitting a wide range of colours into a 2 dimensional square. It's not perfect, but I think it's pretty good.