HOME | DD

burtonsamograd — X-8

Published: 2015-02-07 22:47:09 +0000 UTC; Views: 723; Favourites: 1; Downloads: 0
Redirect to original
Description (eval-when (:compile-toplevel :load-toplevel)
  (require 'vecto))
(in-package :vecto)

(defun j (x n)
  (+ (- x n) (random (* 2 n))))

(defun render (file)
  (let* ((w (/ 10800 1)) (h (/ 7200 1))
         (s (coerce (/ h 64) 'float)))
    (with-canvas (:width w :height h)
      (set-rgba-fill 1 1 1 1)
      (rectangle 0 0 w h)
      (fill-path)

       ;; signature
      (set-rgba-fill 0 0 0 1)
      (set-font (get-font "~/OCRABold.ttf") (/ w 128))
      (draw-string (- w (/ w 32)) (- h (/ h 32)) "X")
      (fill-path)

        (do ((x 0 (incf x s)))
            ((> x w))
          (do ((y 0 (incf y s)))
              ((> y h))
            (let* ((r (* 2 pi (/ x w)))
                   (c (/ (1+ (sin r)) 2.3)))
              (rotate r)
              (set-rgba-fill c c c c)
              (set-rgba-stroke 0 0 0 (random 1.0))
              (rounded-rectangle x y s s s s)
              (fill-path)
              (set-line-width 1)
              (rectangle x y s s)
              (stroke)
              (set-line-width (random s))
              (move-to (+ x s) (+ y s))
              (line-to (+ x s) s)
              (line-to x s)
              (stroke)

              (set-line-width (random s))
              (set-rgba-stroke 1 1 1 (random .4))
              (move-to (+ x s) (+ y s))
              (line-to (+ x s) s)
              (line-to x s)
              (rectangle x y s s)
              (stroke)

              ;;(stroke)
              )))

      (save-png file))))

(render "x-8.png")
Related content
Comments: 0