// Printing colored text based on user format
// User needs to provide one of supported colors
// Example: `this{red} is red{blue} and this is blue. {default} Now is default`
978172
func (p *Printer) InFormat() {
	// find all text groups which need to be colored
	matches := colorGroupRE.FindAllStringSubmatch(p.text, -1)

	for _, value := range matches {
		// extract color from `{color} some text`
		color := colorPartRE.FindStringSubmatch(value[0])[1]
		colorcode := getColor(color)

		// extract text from `{color} some text`
		text := textPartRE.FindStringSubmatch(value[0])[1]

		// format string for ANSI/VT1000 terminal
		clifmt := startSeq + colorcode + text + endSeq
		p.text = strings.Replace(p.text, value[0], clifmt, -1)
	}

	fmt.Fprintln(Out, p.text)
}
174428
func (w *Wrapper) PrintStatus(status status.Status) {
	w.PrintColor(statusColors[status], status)
}
1195773
func (f *Fpdf) GetTextColor() (int, int, int) {
	return f.color.text.ir, f.color.text.ig, f.color.text.ib
}
397736
func (p FmtPrinter) Print(logger *Logger, a ...interface{}) {
	b := make([]interface{}, 1)
	b[0] = logger.Color(logger.Name)
	a = append(b, a...)
	fmt.Fprint(os.Stderr, a...)
}
533139
func printLogs(logs string) error {
	for _, log := range strings.Split(logs, "\n") {
		category := "unknown"
		parts := strings.Split(strings.Split(log, ": ")[0], " ")
		if len(parts) >= 2 {
			category = parts[1]
		}
		colorVars := map[string]string{
			"Color": chooseColor(category),
			"Log":   log,
		}
		fmt.Println(prettyprint.ColorizeVars("{{.V.Color}}{{.V.Log}}{{.C.Default}}", colorVars))
	}

	return nil
}
737382
func (u *UI) ColorString(c Color, s string) string {
	if !u.EnableColors {
		return s
	}

	ctx := ansiterm.Context{
		Foreground: ansiterm.Color(c),
	}

	return createStyledString(ctx, s)
}
468674
func (c *Color) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
	c.setWriter(w)
	defer c.unsetWriter(w)

	return fmt.Fprintln(w, a...)
}
532904
func String() *StringPrinter {
	w := &bytes.Buffer{}
	f := Colour(w)
	return &StringPrinter{f, w}
}
1125862
func PrintFlags() {
	fmt.Println("Printing flags...")
	fmt.Printf("testFlagString:'%s'\n", testFlagString)
	fmt.Printf("testFlagInt:'%d'\n", testFlagInt)
	fmt.Printf("testFlagInt64:'%d'\n", testFlagInt64)
	fmt.Printf("testFlagUint:'%d'\n", testFlagUint)
	fmt.Printf("testFlagUint64:'%d'\n", testFlagUint64)
	fmt.Printf("testFlagBool:'%v'\n", testFlagBool)
	fmt.Printf("testFlagDur:'%v'\n", testFlagDur)
}
723529
func Magenta(ctx context.Context, format string, args ...interface{}) {
	if IsHidden(ctx) && !ctxutil.IsDebug(ctx) {
		return
	}
	fmt.Fprint(Stdout, color.MagentaString(Prefix(ctx)+format+newline(ctx), args...))
}
1229164
func (c *Color) Printf(format string, args ...interface{}) {
	fmt.Fprintf(c.output, format, args...)
}
732572
func (r *readlineUI) PrintErr(args ...interface{}) {
	text := fmt.Sprint(args...)
	if !strings.HasSuffix(text, "\n") {
		text += "\n"
	}
	if readline.IsTerminal(int(syscall.Stderr)) {
		text = colorize(text)
	}
	fmt.Fprint(r.rl.Stderr(), text)
}
1279030
func (m *LevelMetadata) Text(enableColor bool) string {
	if enableColor {
		return m.ColorfulText
	}
	return m.RawText
}
183108
func colorize(text string, c color) string {
	return string(c) + text + string(endColor)
}
480242
func PrettyPrintTo(out io.Writer, i interface{}, nl bool) {
	p := &Pretty{Indent: DEFAULT_INDENT, Out: out, NilString: DEFAULT_NIL}
	if nl {
		p.Println(i)
	} else {
		p.Print(i)
	}
}
1085339
func (c Colorize) Println(v ...interface{}) (int, error) {
	return Println(c.Foreground, c.Background, v...)
}
1166572
func Print(v ...interface{}) {
	if Severity >= LevelInfo {
		std.Output(5, fmt.Sprint(v...), LevelInfo)
	}
}