Color/README.md
2025-06-06 13:51:43 -05:00

504 B

Color

Supported colors: red, green, yellow, blue, purple, cyan, white, gray

fmt.Print(color.Blue("Blue text"))
fmt.Printf("Status: %s\n", color.Green("OK"))
fmt.Println(color.Red("Error occurred"))

blue := color.Blue("Blue text")
warning := color.Yellow("Warning message")

color.SetColors(false)
color.SetColors(true)

if color.ColorsEnabled() {
    // ...
}

Colors are automatically detected based on terminal capabilities and environment variables (NO_COLOR, FORCE_COLOR, TERM).