Saturday, June 13, 2015
Generating looping color gradients with a limited palette
I was trying to generate a Mandelbrot set fractal in Minecraft using a python script. But the palette available is very limited, which led me to thinking how to generate a pleasing color progression out of a limited palette, and then I had a neat idea: just solve the Traveling Salesman Problem for the palette in RGB space. This generates a color progression that can be nicely used for looping the colors. The first version uses the larger palette of wool+hardened clay+redstone (and a version of this simulated annealing code), while the second drops the hardened clay (and now we can get an exact solution using this code).