()
| 46 | } |
| 47 | |
| 48 | func 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 | |
| 64 | func Colorize(message string, textColor color.Attribute) string { |
| 65 | return colorize(message, textColor, 0) |