Some things to try:
Change how it draws the spirograph:
Open the listener ( control-L or use the Decker -> listener menu ), then type:
spirograph.brush: 2
and hit shift-enter. that will change the brush being used to draw (there are lots of numbers you can try). Or go into the code and change the line:
c.pattern: colors.blue
to use a different color (try colors.red, or any number between 0 and 64)
Make it stamp the pattern to an underlying canvas:
- Add a second canvas widget (Tool -> Widget, then Widgets -> New Canvas)
- Move it below the spirograph with Edit -> Move to back.
- Make the spirograph transparent (Widgets -> Show Transparent)
- Add a button widget and have its script copy the image with: the code:
on click do
img: spirograph.copy[]
img: img.map[(38 dict 32}] # changes blue (38) to another color!
canvas1.paste[img 0,0 1] # the 1 makes it respect the transparency
end
you can use the listener to make sure the two canvases ovelap exactly:
canvas1.size:spirograph.size canvas1.pos:spirograph.pos
Want to save your changes? Use file -> save as to save your own version as an .html file on your local computer!