Skip to content

Commit

Permalink
add in other unicode types for underline/bold/etc
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information
ibdknox committed Nov 20, 2011
1 parent f1c9d35 commit a6c40d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion project.clj
@@ -1,3 +1,3 @@
(defproject colorize "0.1.0"
(defproject colorize "0.1.1"
:description "Colorize console output"
:dependencies [[org.clojure/clojure "[1.2.1],[1.3.0]"]])
19 changes: 17 additions & 2 deletions src/colorize/core.clj
Expand Up @@ -10,7 +10,20 @@
:blue "[34m"
:yellow "[33m"
:magenta "[35m"
:cyan "[36m"})
:cyan "[36m"
:black-bg "[40m"
:red-bg "[41m"
:green-bg "[42m"
:yellow-bg "[43m"
:blue-bg "[44m"
:magenta-bg "[45m"
:cyan-bg "[46m"
:white-bg "[47m"
:bold "[1m"
:italic "[3m"
:underline "[4m"
:inverse "[7m"
:strikethrough "[9m"})

(defn ansi
"Get the ansi code for a specific color"
Expand All @@ -21,7 +34,9 @@
"Wrap the given strings in the provided color. Color should be
a keyword and can be any of the following:
[:reset :default :white :black :red :green :blue :yellow :magenta :cyan].
[:reset :default :white :black :red :green :blue :yellow :magenta :cyan
:black-bg :red-bg :green-bg :yellow-bg :blue-bg :magenta-bg :cyan-bg :white-bg
:underline :italic :bold :strikethrough :inverse].
Each of these also has a function created for it: (cyan \"woohoo\")"
[code & s]
Expand Down

0 comments on commit a6c40d2

Please sign in to comment.