fatih/color

Support for `FORCE_COLOR`

cardil opened this issue · 6 comments

It would be a good idea to apart from supporting NO_COLOR to support easy forcing of color output.

The FORCE_COLOR environmental variable is less spread across industry, but still is used in a couple of libraries, i.e. https://github.com/chalk/chalk#supportscolor

I strongly disagree that this feature should be implemented as there are no common standards regarding FORCE_COLOR.

If in future the FORCE_COLOR would be a standardized, then a change in its value handling would be a breaking change from the behavior perspective.

For anyone else who finds this issue, I'm using this workaround:

import "github.com/fatih/color"

func ForceColor() {
	color.NoColor = false
}

Then I just call this at the top of main()

FORCE_COLOR becomes a standard: https://force-color.org/

I think it may be worth to resurrect #156