diff options
author | Kenny Parnell <k.parnell@gmail.com> | 2023-07-20 14:14:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-20 14:14:31 -0400 |
commit | f5b09a434adc4325c4a3254340d5ebc371258def (patch) | |
tree | d5847841fa93fb35f517d2dee04ce4f33fa66ba3 | |
parent | d1ad453ce61aeb1181e5cf86ceb28c888ab92ff2 (diff) |
Switch to termenv.EnvColorProfile() (#387)v0.11.0
* Switch to termenv.EnvColorProfile()
This will allow users to set `NO_COLOR` and `CLICOLOR_FORCE` when they need to override the detected values.
* Update main.go
-rw-r--r-- | format/formats.go | 2 | ||||
-rw-r--r-- | main.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/format/formats.go b/format/formats.go index d123135..412c509 100644 --- a/format/formats.go +++ b/format/formats.go @@ -54,7 +54,7 @@ func markdown(input string, theme string) (string, error) { } func template(input string) (string, error) { - f := termenv.TemplateFuncs(termenv.ColorProfile()) + f := termenv.TemplateFuncs(termenv.EnvColorProfile()) t, err := tpl.New("tpl").Funcs(f).Parse(input) if err != nil { return "", fmt.Errorf("unable to parse template: %w", err) @@ -28,7 +28,7 @@ var ( var bubbleGumPink = lipgloss.NewStyle().Foreground(lipgloss.Color("212")) func main() { - lipgloss.SetColorProfile(termenv.NewOutput(os.Stderr).Profile) + lipgloss.SetColorProfile(termenv.NewOutput(os.Stderr).EnvColorProfile()) if Version == "" { if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" { |