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
).
Version 2 *corrected*
Latest
Languages
Go
100%