https://github.com/abiriadev/iris
low-level ANSI color library for Go
https://github.com/abiriadev/iris
ansi-colors ansi-escape-codes ansicolors golang
Last synced: 9 months ago
JSON representation
low-level ANSI color library for Go
- Host: GitHub
- URL: https://github.com/abiriadev/iris
- Owner: abiriadev
- Created: 2023-11-21T09:19:09.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-01T06:12:44.000Z (about 2 years ago)
- Last Synced: 2025-04-06T02:58:50.380Z (10 months ago)
- Topics: ansi-colors, ansi-escape-codes, ansicolors, golang
- Language: Go
- Homepage:
- Size: 103 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IRIS: a low-level ANSI color manipulation library
## Principles
1. Do NOT implement rare standards (such as fraktur and blink support).
2. Favor explicit over convenient naming, e.g., use `RedFg` instead of `Red`.
3. Do NOT predefine every possible color or famous color sets (like CSS, Xterm). Assume only dynamic color usage.
4. Trust the developers. Provide unsafe methods which might cause unexpected behavior if not used with proper guarantees.
5. Allow partial styling without auto-reset. Allow developers to decide when to close styling.
## Demo
Try these examples in your terminal!
```sh
$ git clone https://github.com/abiriadev/iris && cd iris
```
### Gradient
```sh
$ go run ./examples/gradient
```

### XOR fractal
```sh
$ go run ./examples/xor
```

### IRIScat
[lolcat](https://github.com/busyloop/lolcat) implementation with IRIS.
```sh
$ figlet 'IRIScat: like lolcat but with IRIS' | cowsay -n | go run ./examples/iriscat
```
