Skip to content

Commit

Permalink
Switch to termenv.EnvColorProfile() (#387)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kennyp authored Jul 20, 2023
1 parent d1ad453 commit f5b09a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion format/formats.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down

0 comments on commit f5b09a4

Please sign in to comment.