color icon indicating copy to clipboard operation
color copied to clipboard

Support for `FORCE_COLOR`

Open cardil opened this issue 2 years ago • 5 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

cardil avatar Jan 26 '22 20:01 cardil

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.

pellared avatar Nov 14 '22 22:11 pellared

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()

juanzolotoochin avatar Dec 14 '23 17:12 juanzolotoochin

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

pellared avatar Dec 14 '23 19:12 pellared

I think it may be worth to resurrect https://github.com/fatih/color/pull/156

pellared avatar Dec 14 '23 21:12 pellared