Skip to content

Commit

Permalink
fix(godocs): correct EnvColorProfile description
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Mar 3, 2023
1 parent 8dfefed commit 3231580
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions termenv.go
Expand Up @@ -88,11 +88,13 @@ func EnvColorProfile() Profile {
return output.EnvColorProfile()
}

// EnvNoColor returns true if the environment variables explicitly disable color output
// by setting NO_COLOR (https://no-color.org/)
// or CLICOLOR/CLICOLOR_FORCE (https://bixense.com/clicolors/)
// If NO_COLOR is set, this will return true, ignoring CLICOLOR/CLICOLOR_FORCE
// If CLICOLOR=="0", it will be true only if CLICOLOR_FORCE is also "0" or is unset.
// EnvColorProfile returns the color profile based on environment variables set
// Supports NO_COLOR (https://no-color.org/)
// and CLICOLOR/CLICOLOR_FORCE (https://bixense.com/clicolors/)
// If none of these environment variables are set, this behaves the same as ColorProfile()
// It will return the Ascii color profile if EnvNoColor() returns true
// If the terminal does not support any colors, but CLICOLOR_FORCE is set and not "0"
// then the ANSI color profile will be returned.
func (o *Output) EnvColorProfile() Profile {
if o.EnvNoColor() {
return Ascii
Expand Down

0 comments on commit 3231580

Please sign in to comment.