Skip to content

Instantly share code, notes, and snippets.

@ihercowitz
Created September 18, 2014 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihercowitz/f516360ccbe21186949c to your computer and use it in GitHub Desktop.
Save ihercowitz/f516360ccbe21186949c to your computer and use it in GitHub Desktop.
A color festival for your texts. Maybe this could be used on LOG FIles
(defonce color-map (range 255))
(defn rand-color [max]
(nth color-map (rand-int max)))
(defn rainbownize [& text]
(->> (clojure.string/join #" " text)
seq
(map #(str "\033[38;5;" (rand-color 254) "m" % "\033[0m"))
(apply str)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment