59 lines
1.3 KiB
Markdown
Raw Normal View History

2024-03-05 17:47:02 +01:00
# color
Adds color to your terminal output.
## Features
2024-03-06 00:18:51 +01:00
- RGB color space
2024-03-06 19:23:49 +01:00
- LCH color space (oklch)
2024-03-06 00:18:51 +01:00
- Truecolor terminal output
2024-03-07 23:22:40 +01:00
- Zero dependencies (excluding tests)
2024-03-05 17:47:02 +01:00
## Installation
```shell
go get git.akyoto.dev/go/color
```
## Usage
```go
red := color.RGB(1.0, 0.0, 0.0)
2024-03-05 19:10:27 +01:00
red.Println("red text")
2024-03-06 19:23:49 +01:00
orange := color.LCH(0.7, 1.0, 65)
orange.Println("orange text")
2024-03-05 17:47:02 +01:00
```
## Tests
```
2024-03-06 19:23:49 +01:00
PASS: TestFprint
PASS: TestPrint
2024-03-11 22:09:45 +01:00
PASS: TestPrintf
2024-03-06 19:23:49 +01:00
PASS: TestPrintln
PASS: TestRGB
PASS: TestLCH
PASS: TestLCHSpectrum
2024-03-05 17:47:02 +01:00
coverage: 100.0% of statements
```
## Benchmarks
```
2024-03-11 22:08:28 +01:00
BenchmarkRGB-12 1000000000 0.3211 ns/op 0 B/op 0 allocs/op
BenchmarkLCH-12 4767306 251.8 ns/op 0 B/op 0 allocs/op
BenchmarkFprint-12 4869368 245.7 ns/op 0 B/op 0 allocs/op
BenchmarkFprintRaw-12 23155356 43.73 ns/op 0 B/op 0 allocs/op
BenchmarkPrint-12 358099 3560 ns/op 0 B/op 0 allocs/op
BenchmarkPrintRaw-12 3144412 378.9 ns/op 0 B/op 0 allocs/op
2024-03-05 17:47:02 +01:00
```
## License
Please see the [license documentation](https://akyoto.dev/license).
## Copyright
© 2024 Eduard Urbach