🌈 Adds color to your terminal output. 15 Commits
2025-02-25 16:37:15 +01:00
2025-02-25 16:37:15 +01:00
2024-03-05 17:47:02 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-03-11 14:24:41 +01:00
2025-02-25 16:37:15 +01:00
2024-03-12 15:23:08 +01: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