🌈 Adds color to your terminal output. 3 Commits
2024-03-06 00:18:51 +01:00
.gitignore Initial commit 2024-03-05 17:47:02 +01:00
Benchmarks_test.go Added OKLCH color space 2024-03-06 00:18:51 +01:00
Color_test.go Added OKLCH color space 2024-03-06 00:18:51 +01:00
Color.go Added OKLCH color space 2024-03-06 00:18:51 +01:00
go.mod Initial commit 2024-03-05 17:47:02 +01:00
go.sum Initial commit 2024-03-05 17:47:02 +01:00
LCH.go Added OKLCH color space 2024-03-06 00:18:51 +01:00
README.md Added OKLCH color space 2024-03-06 00:18:51 +01:00
Terminal.go Improved tests 2024-03-05 19:10:27 +01:00

color

Adds color to your terminal output.

Features

  • RGB color space
  • OKLCH color space
  • Truecolor terminal output

Installation

go get git.akyoto.dev/go/color

Usage

red := color.RGB(1.0, 0.0, 0.0)
red.Println("red text")

Tests

PASS: TestNoColors
PASS: TestColors
PASS: TestRainbow
coverage: 100.0% of statements

Benchmarks

BenchmarkRGB-12                	1000000000	         0.3132 ns/op	   0 B/op	       0 allocs/op
BenchmarkLCH-12                	11214220	       107.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkFprintColorized-12    	 6356535	       188.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkFprintRaw-12          	27374659	        43.76 ns/op	       0 B/op	       0 allocs/op

License

Please see the license documentation.

© 2024 Eduard Urbach