This made me curious, so I wrote a javascript version that renders a larger image of it:
http://htmlpreview.github.io/?https://github.com/acmegeek/pr...
I changed it to render with circles vs squares, and have them stack nicely. Also, have the variables more isolated to test. Also, it counts how many primes are within a pack, and assigns the color proportionately. This is still a work in progress.