From 7c939e8dfb0e212999b6611a9b91fecb55400887 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sun, 6 Feb 2022 04:19:46 +0100 Subject: [PATCH] Use termenv's EnvColorProfile, which respects NO_COLOR and CLICOLOR_FORCE env vars --- examples/altscreen-toggle/main.go | 2 +- examples/views/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/altscreen-toggle/main.go b/examples/altscreen-toggle/main.go index c63cee2..539ee52 100644 --- a/examples/altscreen-toggle/main.go +++ b/examples/altscreen-toggle/main.go @@ -9,7 +9,7 @@ import ( ) var ( - color = termenv.ColorProfile().Color + color = termenv.EnvColorProfile().Color keyword = termenv.Style{}.Foreground(color("204")).Background(color("235")).Styled help = termenv.Style{}.Foreground(color("241")).Styled ) diff --git a/examples/views/main.go b/examples/views/main.go index 5b4ed92..1a934be 100644 --- a/examples/views/main.go +++ b/examples/views/main.go @@ -28,7 +28,7 @@ const ( // General stuff for styling the view var ( - term = termenv.ColorProfile() + term = termenv.EnvColorProfile() keyword = makeFgStyle("211") subtle = makeFgStyle("241") progressEmpty = subtle(progressEmptyChar)