color/README.md

63 lines
1.0 KiB
Markdown

# color
Adds color to your terminal output.
## Features
- ANSI colors
- HSL colors
- HSV colors
- LCH colors
- RGB colors
## Installation
```shell
go get git.urbach.dev/go/color
```
## Usage
```go
// ANSI
ansi.Red.Println("red text")
// LCH
green := color.LCH(0.5, 1.0, 135)
green.Println("green text")
// RGB
blue := color.RGB(0, 0, 1)
blue.Println("blue text")
```
## Tests
```
PASS: TestPrint
PASS: TestPrintf
PASS: TestPrintln
PASS: TestHSLSpectrum
PASS: TestHSVSpectrum
PASS: TestLCH
PASS: TestLCHSpectrum
PASS: TestRGB
coverage: 100.0% of statements
```
## Benchmarks
```
BenchmarkRGB-20 100000000 14.88 ns/op 0 B/op 0 allocs/op
BenchmarkLCH-20 5075756 227.8 ns/op 0 B/op 0 allocs/op
BenchmarkPrint-20 1587134 755.5 ns/op 0 B/op 0 allocs/op
BenchmarkPrintRaw-20 3166090 361.5 ns/op 0 B/op 0 allocs/op
```
## License
Please see the [license documentation](https://urbach.dev/license).
## Copyright
© 2024 Eduard Urbach