MCPcopy
hub / github.com/cloudfoundry/cli / colorsEnabled

Function colorsEnabled

cf/terminal/color.go:48–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

46}
47
48func colorsEnabled() bool {
49 if os.Getenv("CF_COLOR") == "true" {
50 return true
51 }
52
53 if os.Getenv("CF_COLOR") == "false" {
54 return false
55 }
56
57 if UserAskedForColors == "true" {
58 return true
59 }
60
61 return UserAskedForColors != "false" && TerminalSupportsColors
62}
63
64func Colorize(message string, textColor color.Attribute) string {
65 return colorize(message, textColor, 0)

Callers 1

InitColorSupportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected