func (s *RGBStyle) Sprint(a ...interface{}) string {
	return RenderCode(s.String(), a...)
}
Sprint returns rendered message
package color
import (
	"fmt"
	"strconv"
	"strings"
)
const (
	TplFgRGB = "38;2;%d;%d;%d"
	TplBgRGB = "48;2;%d;%d;%d"
	FgRGBPfx = "38;2;"
	BgRGBPfx = "48;2;"
)
const (
	AsFg uint8 = iota
	AsBg
)
type RGBColor [4]uint8
var emptyRGBColor = RGBColor{3: 99}
func RGB(r, g, b uint8, isBg ...bool) RGBColor {
	rgb := RGBColor{r, g, b}
	if len(isBg) > 0 && isBg[0] {
		rgb[3] = AsBg
	}
	return rgb
}
func Rgb(r, g, b uint8, isBg ...bool) RGBColor { return RGB(r, g, b, isBg...) }
func Bit24(r, g, b uint8, isBg ...bool) RGBColor { return RGB(r, g, b, isBg...) }
func RGBFromSlice(rgb []uint8, isBg ...bool) RGBColor {
	return RGB(rgb[0], rgb[1], rgb[2], isBg...)
}
func HEX(hex string, isBg ...bool) RGBColor {
	if rgb := HexToRgb(hex); len(rgb) > 0 {
		return RGB(uint8(rgb[0]), uint8(rgb[1]), uint8(rgb[2]), isBg...)
	}
	return emptyRGBColor
}
func Hex(hex string, isBg ...bool) RGBColor { return HEX(hex, isBg...) }
func RGBFromString(rgb string, isBg ...bool) RGBColor {
	ss := stringToArr(rgb, ",")
	if len(ss) != 3 {
		return emptyRGBColor
	}
	var ar [3]int
	for i, val := range ss {
		iv, err := strconv.Atoi(val)
		if err != nil {
			return emptyRGBColor
		}
		ar[i] = iv
	}
	return RGB(uint8(ar[0]), uint8(ar[1]), uint8(ar[2]), isBg...)
}
func (c RGBColor) Set() error {
	return SetTerminal(c.String())
}
func (c RGBColor) Reset() error {
	return ResetTerminal()
}
func (c RGBColor) Print(a ...interface{}) {
	doPrintV2(c.String(), fmt.Sprint(a...))
}
func (c RGBColor) Printf(format string, a ...interface{}) {
	doPrintV2(c.String(), fmt.Sprintf(format, a...))
}
func (c RGBColor) Println(a ...interface{}) {
	doPrintlnV2(c.String(), a)
}
func (c RGBColor) Sprint(a ...interface{}) string {
	return RenderCode(c.String(), a...)
}
func (c RGBColor) Sprintf(format string, a ...interface{}) string {
	return RenderString(c.String(), fmt.Sprintf(format, a...))
}
func (c RGBColor) Values() []int {
	return []int{int(c[0]), int(c[1]), int(c[2])}
}
func (c RGBColor) Code() string {
	return fmt.Sprintf("%d;%d;%d", c[0], c[1], c[2])
}
func (c RGBColor) Hex() string {
	return fmt.Sprintf("%02x%02x%02x", c[0], c[1], c[2])
}
func (c RGBColor) FullCode() string {
	return c.String()
}
func (c RGBColor) String() string {
	if c[3] == AsFg {
		return fmt.Sprintf(TplFgRGB, c[0], c[1], c[2])
	}
	if c[3] == AsBg {
		return fmt.Sprintf(TplBgRGB, c[0], c[1], c[2])
	}
	return ""
}
func (c RGBColor) IsEmpty() bool {
	return c[3] > AsBg
}
func (c RGBColor) C256() Color256 {
	return C256(RgbTo256(c[0], c[1], c[2]), c[3] == AsBg)
}
func (c RGBColor) Basic() Color {
	return Color(Rgb2basic(c[0], c[1], c[2], c[3] == AsBg))
}
func (c RGBColor) Color() Color { return c.Basic() }
func (c RGBColor) C16() Color { return c.Basic() }
type RGBStyle struct {
	Name string
	opts Opts
	fg, bg RGBColor
}
func NewRGBStyle(fg RGBColor, bg ...RGBColor) *RGBStyle {
	s := &RGBStyle{}
	if len(bg) > 0 {
		s.SetBg(bg[0])
	}
	return s.SetFg(fg)
}
func HEXStyle(fg string, bg ...string) *RGBStyle {
	s := &RGBStyle{}
	if len(bg) > 0 {
		s.SetBg(HEX(bg[0]))
	}
	if len(fg) > 0 {
		s.SetFg(HEX(fg))
	}
	return s
}
func RGBStyleFromString(fg string, bg ...string) *RGBStyle {
	s := &RGBStyle{}
	if len(bg) > 0 {
		s.SetBg(RGBFromString(bg[0]))
	}
	return s.SetFg(RGBFromString(fg))
}
func (s *RGBStyle) Set(fg, bg RGBColor, opts ...Color) *RGBStyle {
	return s.SetFg(fg).SetBg(bg).SetOpts(opts)
}
func (s *RGBStyle) SetFg(fg RGBColor) *RGBStyle {
	fg[3] = 1  
	s.fg = fg
	return s
}
func (s *RGBStyle) SetBg(bg RGBColor) *RGBStyle {
	bg[3] = 1  
	s.bg = bg
	return s
}
func (s *RGBStyle) SetOpts(opts Opts) *RGBStyle {
	s.opts = opts
	return s
}
func (s *RGBStyle) AddOpts(opts ...Color) *RGBStyle {
	s.opts.Add(opts...)
	return s
}
func (s *RGBStyle) Print(a ...interface{}) {
	doPrintV2(s.String(), fmt.Sprint(a...))
}
func (s *RGBStyle) Printf(format string, a ...interface{}) {
	doPrintV2(s.String(), fmt.Sprintf(format, a...))
}
func (s *RGBStyle) Println(a ...interface{}) {
	doPrintlnV2(s.String(), a)
}