Skip to content

Instantly share code, notes, and snippets.

@quephird
Last active December 10, 2015 17:38
Show Gist options
  • Save quephird/4468517 to your computer and use it in GitHub Desktop.
Save quephird/4468517 to your computer and use it in GitHub Desktop.
Playing around with alphas
(ns untitled-20130106
(:use quil.core clojure.pprint))
(def screen-w 1920)
(def screen-h 1050)
(defn- random-rgba []
[0
(random 255)
(random 255)
(random 127)])
(defn- random-xylw []
[(- (random screen-w) 150)
(- (random screen-h) 150)
(+ (random 200) 100)
(+ (random 200) 100)])
(defn- gen-filename [title format]
(cl-format
nil
(str title "-~D~2,'0D~2,'0D-~2,'0D~2,'0D~2,'0D." format)
(year) (month) (day) (hour) (minute) (seconds)))
(defn setup []
(background 0)
(smooth)
(no-stroke)
(no-loop)
(color-mode :rgb)
(ellipse-mode :corner)
)
(defn draw []
(doseq [_ (range 500)]
(apply fill (random-rgba))
(apply ellipse (random-xylw))
; (apply rect (random-xylw))
)
(save (gen-filename "untitled" "png"))
)
(defsketch main
:title "untitled 20130106"
:setup setup
:draw draw
:size [screen-w screen-h]
:renderer :opengl
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment