func (s *screen) color(i []string) {
	s.style = s.style.color(i)
}
Apply color instruction codes to the screen's current style
package terminal
import (
	"math"
	"strconv"
	"strings"
)
type screen struct {
	x      int
	y      int
	screen [][]node
	style  *style
}
const screenEndOfLine = -1
const screenStartOfLine = 0
func (s *screen) clear(y int, xStart int, xEnd int) {
	if len(s.screen) <= y {
		return
	}
	if xStart == screenStartOfLine && xEnd == screenEndOfLine {
		s.screen[y] = make([]node, 0, 80)
	} else {
		line := s.screen[y]
		if xEnd == screenEndOfLine {
			xEnd = len(line) - 1
		}
		for i := xStart; i <= xEnd && i < len(line); i++ {
			line[i] = emptyNode
		}
	}
}
func pi(s string) int {
	if s == "" {
		return 1
	}
	i, _ := strconv.ParseInt(s, 10, 8)
	return int(i)
}
func (s *screen) up(i string) {
	s.y -= pi(i)
	s.y = int(math.Max(0, float64(s.y)))
}
func (s *screen) down(i string) {
	s.y += pi(i)
}
func (s *screen) forward(i string) {
	s.x += pi(i)
}
func (s *screen) backward(i string) {
	s.x -= pi(i)
	s.x = int(math.Max(0, float64(s.x)))
}
func (s *screen) growScreenHeight() {
	for i := len(s.screen); i <= s.y; i++ {
		s.screen = append(s.screen, make([]node, 0, 80))
	}
}
func (s *screen) growLineWidth(line []node) []node {
	for i := len(line); i <= s.x; i++ {
		line = append(line, emptyNode)
	}
	return line
}
func (s *screen) write(data rune) {
	s.growScreenHeight()
	line := s.screen[s.y]
	line = s.growLineWidth(line)
	line[s.x] = node{blob: data, style: s.style}
	s.screen[s.y] = line
}
func (s *screen) append(data rune) {
	s.write(data)
	s.x++
}
func (s *screen) appendMany(data []rune) {
	for _, char := range data {
		s.append(char)
	}
}
func (s *screen) appendElement(i *element) {
	s.growScreenHeight()
	line := s.growLineWidth(s.screen[s.y])
	line[s.x] = node{style: s.style, elem: i}
	s.screen[s.y] = line
	s.x++
}