Skip to content

justinj/sparkles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sparkles

A library for formatting text in a terminal. Only color for now.

Usage

(ns foo.bar
  (require sparkles.core :as sparkles))

(def red (sparkles/color {:fg :red}))
(def underlined-blue (sparkles/color {:bg     :blue
                                      :styles [:underline]}))

(println (red "This is red..."))
(println (underlined-blue "This is underlined with a blue background."))

gives

Colors compose properly:

(println (blue "hello" (red " hi ") "hello"))

works as you would expect.

The foreground colors are all pre-defined, take a look at src/sparkles/core.pxi, it's pretty straightforward.

About

Coloured terminal output for Pixie

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages