The initial version used Wu's circle algorithm to generate one quarter of an anti-aliased circle, then flipped it or translated it to get all four corners. That was pretty fast, but as the radius got big (I allow up to 150 pixels), it consed a lot (about 300KB) and got pretty slow (about 0.25s for four graphics).
The output images differ by foreground, background, and size. Since GIF is an indexed image format, changing the color table doesn't involve changing a single bit of image data. If you have an existing GIF for each allowed size, you can make a new image in any color by reading the "template" gif, munging its color table in memory, and writing out a new file. With that strategy, making any size from 2 to 150 pixels in any color takes a relatively constant 0.001s, and it takes only about 3MB of template images.