Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/miloas/colorstr

A Clojure library to stylized string in console using ANSI escape code.
https://github.com/miloas/colorstr

Last synced: 8 days ago
JSON representation

A Clojure library to stylized string in console using ANSI escape code.

Awesome Lists containing this project

README

        

# colorstr

A Clojure library to stylized string in console using ANSI escape code.

## Usage

```clojure
;For leiningen,add to your require
[colorstr "0.1.0"]
```
## Example

```clojure
-> (println (style "Its red" :red))
=> "Its red" ;text color is red

-> (println (style "Its bright and red,backgroud is blue" :red :bright :bg-blue))
```

```clojure
;All style you can select.
{:strikethrough-off
:strikethrough
:inverse-off
:inverse
:underline-off
:underline
:blink-slow
:bright
:reset

:default
:white
:black
:red
:green
:blue
:yellow
:megenta
:cyan

:bg-default
:bg-white
:bg-black
:bg-red
:bg-green
:bg-blue
:bg-yellow
:bg-megenta
:bg-cyan
}
```

## Tips

```clojure
;same class will be cover

-> (style "red" :blue :red)
;Same as (style "red" :red)

```
## License

MIT.