func IsSupportColor() bool {
	return IsSupport16Color()
}
IsSupportColor check current console is support color.

NOTICE: The method will detect terminal info each times,
if only want get current color level, please direct call SupportColor() or TermColorLevel()
package color
import (
	"io"
	"io/ioutil"
	"os"
	"runtime"
	"strconv"
	"strings"
	"syscall"
	"github.com/xo/terminfo"
)
func DetectColorLevel() terminfo.ColorLevel {
	level, _ := detectTermColorLevel()
	return level
}
func detectTermColorLevel() (level terminfo.ColorLevel, needVTP bool) {
	if val := os.Getenv("WSL_DISTRO_NAME"); val != "" {
		if detectWSL() {
			debugf("True Color support on WSL environment")
			return terminfo.ColorLevelMillions, false
		}
	}
	isWin := runtime.GOOS == "windows"
	termVal := os.Getenv("TERM")
	if termVal != "screen" {
		val := os.Getenv("TERMINAL_EMULATOR")
		if val == "JetBrains-JediTerm" {
			debugf("True Color support on JetBrains-JediTerm, is win: %v", isWin)
			return terminfo.ColorLevelMillions, isWin
		}
	}
	level = detectColorLevelFromEnv(termVal, isWin)
	debugf("color level by detectColorLevelFromEnv: %s", level.String())
	if level == terminfo.ColorLevelNone {
		debugf("level none - fallback check special term color support")
		level, needVTP = detectSpecialTermColor(termVal)
	}
	return
}
func detectColorLevelFromEnv(termVal string, isWin bool) terminfo.ColorLevel {
	colorTerm, termProg, forceColor := os.Getenv("COLORTERM"), os.Getenv("TERM_PROGRAM"), os.Getenv("FORCE_COLOR")
	switch {
	case strings.Contains(colorTerm, "truecolor") || strings.Contains(colorTerm, "24bit"):
		if termVal == "screen" {  
			return terminfo.ColorLevelHundreds
		}
		return terminfo.ColorLevelMillions
	case colorTerm != "" || forceColor != "":
		return terminfo.ColorLevelBasic
	case termProg == "Apple_Terminal":
		return terminfo.ColorLevelHundreds
	case termProg == "Terminus" || termProg == "Hyper":
		if termVal == "screen" {  
			return terminfo.ColorLevelHundreds
		}
		return terminfo.ColorLevelMillions
	case termProg == "iTerm.app":
		if termVal == "screen" {  
			return terminfo.ColorLevelHundreds
		}
		ver := os.Getenv("TERM_PROGRAM_VERSION")
		if ver != "" {
			i, err := strconv.Atoi(strings.Split(ver, ".")[0])
			if err != nil {
				saveInternalError(terminfo.ErrInvalidTermProgramVersion)
				return terminfo.ColorLevelHundreds
			}
			if i == 3 {
				return terminfo.ColorLevelMillions
			}
		}
		return terminfo.ColorLevelHundreds
	}
	if !isWin && termVal != "" {
		debugf("TERM=%s - check color level by load terminfo file", termVal)
		ti, err := terminfo.Load(termVal)
		if err != nil {
			saveInternalError(err)
			return terminfo.ColorLevelNone
		}
		debugf("the loaded term info file is: %s", ti.File)
		v, ok := ti.Nums[terminfo.MaxColors]
		switch {
		case !ok || v <= 16:
			return terminfo.ColorLevelNone
		case ok && v >= 256:
			return terminfo.ColorLevelHundreds
		}
		return terminfo.ColorLevelBasic
	}
	return terminfo.ColorLevelNone
}
var detectedWSL bool
var wslContents string
func detectWSL() bool {
	if !detectedWSL {
		detectedWSL = true
		b := make([]byte, 1024)
		f, err := os.Open("/proc/version")
		if err == nil {
			_, _ = f.Read(b)  
			if err = f.Close(); err != nil {
				saveInternalError(err)
			}
			wslContents = string(b)
			return strings.Contains(wslContents, "Microsoft")
		}
	}
	return false
}
func isWSL() bool {
	if val := os.Getenv("WSL_DISTRO_NAME"); val == "" {
		return false
	}
	wsl, err := ioutil.ReadFile("/proc/sys/kernel/osrelease")
	if err != nil {
		saveInternalError(err)
		return false
	}
	content := strings.ToLower(string(wsl))
	return strings.Contains(content, "microsoft")
}
func IsWindows() bool {
	return runtime.GOOS == "windows"
}
func IsConsole(w io.Writer) bool {
	o, ok := w.(*os.File)
	if !ok {
		return false
	}
	fd := o.Fd()
	return fd == uintptr(syscall.Stdout) || fd == uintptr(syscall.Stdin) || fd == uintptr(syscall.Stderr)
}
func IsMSys() bool {
	if len(os.Getenv("MSYSTEM")) > 0 {
		return true
	}
	return false
}