🌈 Adds color to your terminal output.
|
|
||
|---|---|---|
| ansi | ||
| tty | ||
| .gitignore | ||
| bench_test.go | ||
| Color.go | ||
| Color_test.go | ||
| go.mod | ||
| go.sum | ||
| HSL.go | ||
| HSL_test.go | ||
| HSV.go | ||
| HSV_test.go | ||
| LCH.go | ||
| LCH_test.go | ||
| readme.md | ||
| Redirect.go | ||
| Redirect_test.go | ||
| RGB.go | ||
| RGB_test.go | ||
| Terminal.go | ||
| Value.go | ||
color
Adds color to your terminal output.
Features
- ANSI colors
- HSL colors
- HSV colors
- LCH colors
- RGB colors
Installation
go get git.urbach.dev/go/color
Usage
// 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
PASS: TestRedirect
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.
Copyright
© 2024 Eduard Urbach