fatih / color

Color package for Go (golang)
https://pkg.go.dev/github.com/fatih/color
MIT License
7.26k stars 615 forks source link

Force color #71

Closed NeilRickards closed 7 years ago

NeilRickards commented 7 years ago

Like the color.NoColor flag it would be good to have a global flag to force color output.

use case: Currently if I pipe the output to less the color is automatically disabled because it is not detected as a tty. I would like to do something like myApp --color | less -r

fatih commented 7 years ago

Why not set it to false? It would mean color is enabled always.

NeilRickards commented 7 years ago

Set what to false?

fatih commented 7 years ago

color.NoColor = false

NeilRickards commented 7 years ago

Ah yes - that's working. Thanks very much! Closing ticket. Might be worth adding to the README.