Liking cljdoc? Tell your friends :D

terminal-render

Render code page 437 terminal stuff to a Swing Graphics, an ANSI terminal, javascript (TODO).

Instalation

In Leiningen:

    [terminal-render "0.2.0"]

Usage

Call new-awt-renderer or new-ansi-renderer to get a render function:

(def render-terminal (new-ansi-renderer {:width 80 :height 20}))

Then send a map of [x y] to { :c :fg :bg } to render it.

(render-terminal { [1 1] { :c 249 :fg { :r 250 :g 250 :b 250 } :bg { :r 0 :g 0 :b 0 }
                   [7 4] { :c \@  :fg { :r 250 :g 250 :b 250 } :bg { :r 0 :g 0 :b 0 } })

blank-terminal, add-char, and add-string can make things easier.

(render-terminal (-> (blank-terminal)
                     (add-string "Testing" 2 2 { :r 250 :g 250 :b 250 } nil)
                     (add-char \@ 9 8 { :r 250 :g 250 :b 250 } nil)))

License

Copyright © 2015 Trystan

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close