Created
September 18, 2014 19:23
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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