(define image-series (lambda (n width height) (let* ((color0 (rgb-new (modulo (* n n n) 256) (modulo (* n n n n n) 256) (modulo (+ n 666) 256))) (colors (vector color0 (rgb-complement color0) (rgb-complement (rgb-rotate color0)) (rgb-rotate color0))) (numcolors (vector-length colors)) (color1 (vector-ref colors (modulo n numcolors))) (color2 (rgb-complement color1)) (color3 (vector-ref colors (modulo (+ n 1) numcolors))) (color4 (rgb-complement color3)) (color5 (vector-ref colors (modulo (+ n 2) numcolors))) (color6 (rgb-complement color5)) (color7 (vector-ref colors (modulo (+ n 3) numcolors))) (color8 (rgb-complement color7)) (image (image.new width height))) ;1st quadrant (context-set-fgcolor! color1) (image-select-rectangle! image selection-replace 0 0 (/ width 2) (/ height 2)) (image-fill! image) (context-set-fgcolor! color2) (image-select-ellipse! image selection-replace (/ width 8) (/ height 8) (/ width 4) (/ height 4)) (image-fill! image) (let ((modn1000 (modulo n 1000))) (cond ((and (>= modn1000 0) (< modn1000 250)) (context-set-brush! "Confetti")) ((and (>= modn1000 250) (< modn1000 500)) (context-set-brush! "Circle Fuzzy (15)")) ((and (>= modn1000 500) (< modn1000 750)) (context-set-brush! "Galaxy, Small (AP)")) ((and (>= modn1000 750) (< modn1000 1000)) (context-set-brush! "Pencil Sketch#1"))) (image-stroke! image) ;2nd quadrant (context-set-fgcolor! color3) (image-select-rectangle! image selection-replace (/ width 2) 0 (- width 1) (/ height 2)) (image-fill! image) (context-set-fgcolor! color4) (image-select-ellipse! image selection-replace (+ (/ width 8) (/ width 2)) (/ height 8) (/ width 4) (/ height 4)) (image-fill! image) (image-stroke! image) ;3rd quadrant (context-set-fgcolor! color5) (image-select-rectangle! image selection-replace 0 (/ height 2) (/ width 2) (- height 1)) (image-fill! image) (context-set-fgcolor! color6) (image-select-ellipse! image selection-replace (/ width 8) (+ (/ height 8) (/ height 2)) (/ width 4) (/ height 4)) (image-fill! image) (image-stroke! image) ;4th quadrant (context-set-fgcolor! color7) (image-select-rectangle! image selection-replace (/ width 2) (/ height 2) (- width 1) (- height 1)) (image-fill! image) (context-set-fgcolor! color8) (image-select-ellipse! image selection-replace (+ (/ width 8) (/ width 2)) (+ (/ height 8) (/ height 2)) (/ width 4) (/ height 4)) (image-fill! image) (image-stroke! image) (image-select-nothing! image) (context-set-fgcolor! "black") (context-set-brush! "Circle (05)") (image-draw-line! image (/ width 2) 0 (/ width 2) height) (image-draw-line! image 0 (/ height 2) width (/ height 2)) (image.show image)))))