package formatters

import (
	
	

	
)

// TTY16m is a true-colour terminal formatter.
var TTY16m = Register("terminal16m", chroma.FormatterFunc(trueColourFormatter))

func trueColourFormatter( io.Writer,  *chroma.Style,  chroma.Iterator) error {
	 = clearBackground()
	for  := ();  != chroma.EOF;  = () {
		 := .Get(.Type)
		if !.IsZero() {
			 := ""
			if .Bold == chroma.Yes {
				 += "\033[1m"
			}
			if .Underline == chroma.Yes {
				 += "\033[4m"
			}
			if .Italic == chroma.Yes {
				 += "\033[3m"
			}
			if .Colour.IsSet() {
				 += fmt.Sprintf("\033[38;2;%d;%d;%dm", .Colour.Red(), .Colour.Green(), .Colour.Blue())
			}
			if .Background.IsSet() {
				 += fmt.Sprintf("\033[48;2;%d;%d;%dm", .Background.Red(), .Background.Green(), .Background.Blue())
			}
			fmt.Fprint(, )
		}
		fmt.Fprint(, .Value)
		if !.IsZero() {
			fmt.Fprint(, "\033[0m")
		}
	}
	return nil
}