🌈 Adds color to your terminal output.
Find a file
Eduard Urbach 222306e0b5
All checks were successful
/ test (push) Successful in 17s
Updated dependencies
2025-06-06 17:12:19 +02:00
ansi Updated formatting 2025-06-06 17:05:55 +02:00
tty Updated formatting 2025-06-06 17:05:55 +02:00
.gitignore Updated formatting 2025-06-06 17:05:55 +02:00
bench_test.go Renamed files 2025-06-06 17:07:05 +02:00
Color.go Updated formatting 2025-06-06 17:05:55 +02:00
Color_test.go Updated formatting 2025-06-06 17:05:55 +02:00
go.mod Updated dependencies 2025-06-06 17:12:19 +02:00
go.sum Updated dependencies 2025-06-06 17:12:19 +02:00
HSL.go Updated formatting 2025-06-06 17:05:55 +02:00
HSL_test.go Updated formatting 2025-06-06 17:05:55 +02:00
HSV.go Updated formatting 2025-06-06 17:05:55 +02:00
HSV_test.go Updated formatting 2025-06-06 17:05:55 +02:00
LCH.go Updated formatting 2025-06-06 17:05:55 +02:00
LCH_test.go Updated formatting 2025-06-06 17:05:55 +02:00
readme.md Renamed files 2025-06-06 17:07:05 +02:00
RGB.go Updated formatting 2025-06-06 17:05:55 +02:00
RGB_test.go Updated formatting 2025-06-06 17:05:55 +02:00
Terminal.go Updated formatting 2025-06-06 17:05:55 +02:00
Value.go Updated formatting 2025-06-06 17:05:55 +02:00

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
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.

© 2024 Eduard Urbach