https://github.com/miloas/colorstr
A Clojure library to stylized string in console using ANSI escape code.
https://github.com/miloas/colorstr
Last synced: 17 days ago
JSON representation
A Clojure library to stylized string in console using ANSI escape code.
- Host: GitHub
- URL: https://github.com/miloas/colorstr
- Owner: Miloas
- Created: 2015-08-13T04:59:15.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-13T10:18:46.000Z (almost 11 years ago)
- Last Synced: 2025-01-03T20:43:51.102Z (over 1 year ago)
- Language: Clojure
- Size: 121 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.