HOME | DD

burtonsamograd — X-2

#abstract #vector
Published: 2015-02-06 02:59:15 +0000 UTC; Views: 785; Favourites: 0; Downloads: 0
Redirect to original
Description (eval-when (:compile-toplevel :load-toplevel)
  (require 'vecto))
(in-package :vecto)

(defun j (x n)
  (+ (- x n) (random (coerce (* 2 n) 'float))))

(defun render (file)
  (let* ((w 10800) (h 7200) (snap (/ w 64)))
    (with-canvas (:width w :height h)
      ;; background
      (set-rgba-fill (/ 223 255) (/ 193 255) (/ 143 255) 1)
      (rectangle 0 0 w h)
      (fill-path)

      ;; render
      (dotimes (i 33)
        (let ((x (random w))
              (y (random h))
              (alpha (random .25))
              (r (1+ (random (coerce (/ w 10) 'float)))))
          (dotimes (j 11)
            (set-rgba-stroke (/ 169 255) (/ 125 255) (/ 93 255) (j alpha .1))
            (set-line-width r)
            (arc (j x (/ snap 64)) (j y (/ snap 64)) (j r (/ w 250))
                 (random (* 2 pi)) (random (* 2 pi)))
            (stroke))
          (dotimes (j 3)
            (set-line-width (random (coerce (/ w 128) 'float)))
            (set-rgba-stroke 0 0 0 (+ .5 (random .5)))
            (arc (j x (/ snap 64)) (j y (/ snap 64)) (j r (/ w 250))  0 (* 2 pi))
            (stroke))
          (stroke)
          (let ((a (random .2))
                (w (/ w 1024)))
            (dotimes (j 10)
              (set-rgba-stroke (/ 169 255) (/ 125 255) (/ 93 255) a)
              (set-line-width w)
              (move-to 0 y)
              (line-to w y)
              (stroke)
              (move-to x 0)
              (line-to x h)
              (stroke)
              (setq w (* w 2))
              (setq a (/ a 2))
              }))

          (stroke)))

      ;; signature
      (set-rgba-fill 0 0 0 1)
      (set-font (get-font "~/OCRABold.ttf") (/ w 128))
      (draw-string (- w (/ w 32)) (/ h 32) "X")
      (fill-path)
      (save-png file))))
(render "x-2.png")
;; burton samograd 2015
Related content
Comments: 0