// Similar to fmt.Sprint, will reset the color at the end.
324614
func Sprint(a ...interface{}) string {
	a = append(a, ResetCode)
	compileValues(&a)
	return fmt.Sprint(a...)
}
475395
func initPrefix(colored bool) {
	if colored {
		Prefix[TRACE] = fmt.Sprintf(ColoredPrefixFormat, GRAY, TRACE.String())
		Prefix[DEBUG] = fmt.Sprintf(ColoredPrefixFormat, GREEN, DEBUG.String())
		Prefix[INFO] = fmt.Sprintf(ColoredPrefixFormat, BLUE, INFO.String())
		Prefix[WARNING] = fmt.Sprintf(ColoredPrefixFormat, YELLOW, WARNING.String())
		Prefix[ERROR] = fmt.Sprintf(ColoredPrefixFormat, RED, ERROR.String())
		Prefix[CRITICAL] = fmt.Sprintf(ColoredPrefixFormat, RED, CRITICAL.String())
	} else {
		Prefix[TRACE] = fmt.Sprintf(PrefixFormat, TRACE.String())
		Prefix[DEBUG] = fmt.Sprintf(PrefixFormat, DEBUG.String())
		Prefix[INFO] = fmt.Sprintf(PrefixFormat, INFO.String())
		Prefix[WARNING] = fmt.Sprintf(PrefixFormat, WARNING.String())
		Prefix[ERROR] = fmt.Sprintf(PrefixFormat, ERROR.String())
		Prefix[CRITICAL] = fmt.Sprintf(PrefixFormat, CRITICAL.String())
	}
}
702756
func init() {
	colors = make(map[string]string)
	colors["black"] = "30m"
	colors["red"] = "31m"
	colors["green"] = "32m"
	colors["yellow"] = "33m"
	colors["blue"] = "34m"
	colors["magenta"] = "35m"
	colors["cyan"] = "36m"
	colors["white"] = "37m"
	colors["default"] = "39m"

	if runtime.GOOS == "windows" {
    	Out = ansicolor.NewAnsiColorWriter(os.Stdout)
	} else {
		Out = os.Stdout
	}
}
796466
func (writer *ConsoleWriter) SetColored(colored bool) {
	writer.lock.Lock()
	defer writer.lock.Unlock()

	if colored == writer.colored {
		return
	}

	writer.colored = colored

	initPrefix(colored)
}
378125
func FColor256(color int) string {
	if color < 0 || color > 255 {
		panic(fmt.Sprintf("颜色值color[%v]只能介于[0,255]之间", color))
	}

	return "\033[38;5;" + strconv.Itoa(color) + "m"
}
679354
func (rr *rasterRenderer) SetFillColor(c drawing.Color) {
	rr.s.FillColor = c
}
616783
func Magenta(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.Magenta()
	}
	return value{value: arg, color: MagentaFg}
}
1330070
func Sprintf(format string, a ...interface{}) string {
	return fmt.Sprintf(format, formatAll(a)...)
}
466603
func SetColored(colored bool) {
	singltonLock.RLock()
	defer singltonLock.RUnlock()

	blog.SetColored(colored)
}
110452
func Panic(v ...interface{}) {
	s := fmt.Sprint(v...)
	log.Output(2, s)
	panic(s)
}
1056505
func (c *ContentObj) AppendStreamSetColorStroke(r uint8, g uint8, b uint8) {
	var cache cacheContentColor
	cache.colorType = colorTypeStroke
	cache.r = r
	cache.g = g
	cache.b = b
	c.listCache.append(&cache)
}
209760
func (d *DropDown) SetPrefixTextColor(color tcell.Color) *DropDown {
	d.prefixTextColor = color
	return d
}
460063
func (writer *MultiWriter) SetColored(colored bool) {
	writer.colored = colored
	for _, fileWriter := range writer.writers {
		fileWriter.SetColored(colored)
	}
}
1374224
func (imd *IMDraw) Reset() {
	imd.points = imd.points[:0]
	imd.Color = pixel.Alpha(1)
	imd.Picture = pixel.ZV
	imd.Intensity = 0
	imd.Precision = 64
	imd.EndShape = NoEndShape
}
955806
func (gp *GoPdf) SetStrokeColor(r uint8, g uint8, b uint8) {
	gp.getContent().AppendStreamSetColorStroke(r, g, b)
}
350102
func normaliseColour(colour string) string {
	if ansi, ok := ANSI2RGB[colour]; ok {
		return ansi
	}
	if strings.HasPrefix(colour, "#") {
		colour = colour[1:]
		if len(colour) == 3 {
			return colour[0:1] + colour[0:1] + colour[1:2] + colour[1:2] + colour[2:3] + colour[2:3]
		}
	}
	return colour
}
1079936
func (c *Color) SprintfFunc() func(format string, a ...interface{}) string {
	return func(format string, a ...interface{}) string {
		return c.wrap(fmt.Sprintf(format, a...))
	}
}