Paste the pastebin code, and then change the KilominxState variable to be whatever kilominx state you want. Note that it only supports the colour names defined spanning from line 4 to line 15.
Then, save the program, refresh the page(?), then click “Settings” under the program and set width and height to 500. After doing that and saving again, you can either get the image by screenshotting and cropping, but the way I would do it is going to your profile, going to your list of programs, and saving the preview image to photos.
kilominx image gen khan academy processingjs enviorment - Pastebin.com