func detectSpecialTermColor(termVal string) (tl terminfo.ColorLevel, needVTP bool) {
	if os.Getenv("ConEmuANSI") == "ON" {
		debugf("support True Color by ConEmuANSI=ON")
		return terminfo.ColorLevelMillions, false
	}
	if buildNumber < 10586 || winVersion < 10 {
		if os.Getenv("ANSICON") != "" {
			conVersion := os.Getenv("ANSICON_VER")
			if conVersion >= "181" {
				return terminfo.ColorLevelHundreds, false
			}
			return terminfo.ColorLevelBasic, false
		}
		return terminfo.ColorLevelNone, false
	}
	if buildNumber < 14931 {
		return terminfo.ColorLevelHundreds, true
	}
	debugf("support True Color on windows version is >= build 14931")
	return terminfo.ColorLevelMillions, true
}
refer
https://github.com/Delta456/box-cli-maker/blob/7b5a1ad8a016ce181e7d8b05e24b54ff60b4b38a/detect_windows.go#L30-L57
https://github.com/gookit/color/issues/25#issuecomment-738727917
detects the Color Level Supported on windows: cmd, powerShell
package color
import (
	"os"
	"syscall"
	"unsafe"
	"github.com/xo/terminfo"
	"golang.org/x/sys/windows"
)
var (
	kernel32 *syscall.LazyDLL
	procGetConsoleMode *syscall.LazyProc
	procSetConsoleMode *syscall.LazyProc
)
func init() {
	if !SupportColor() {
		isLikeInCmd = true
		return
	}
	if !Enable {
		return
	}
	tryEnableVTP(needVTP)
}
func tryEnableVTP(enable bool) bool {
	if !enable {
		return false
	}
	debugf("True-Color by enable VirtualTerminalProcessing on windows")
	initKernel32Proc()
	if tryEnableOnCONOUT() {
		return true
	}
	return tryEnableOnStdout()
}
func initKernel32Proc() {
	if kernel32 != nil {
		return
	}
	kernel32 = syscall.NewLazyDLL("kernel32.dll")
	procGetConsoleMode = kernel32.NewProc("GetConsoleMode")
	procSetConsoleMode = kernel32.NewProc("SetConsoleMode")
}
func tryEnableOnCONOUT() bool {
	outHandle, err := syscall.Open("CONOUT$", syscall.O_RDWR, 0)
	if err != nil {
		saveInternalError(err)
		return false
	}
	err = EnableVirtualTerminalProcessing(outHandle, true)
	if err != nil {
		saveInternalError(err)
		return false
	}
	return true
}
func tryEnableOnStdout() bool {
	err := EnableVirtualTerminalProcessing(syscall.Stdout, true)
	if err != nil {
		saveInternalError(err)
		return false
	}
	return true
}
var (
	winVersion, _, buildNumber = windows.RtlGetNtVersionNumbers()
)