func ColorRGB(r, g, b uint8) StyleOption {
	return func(t *styleComponent) {
		t.fgColor = color.RGB(r, g, b)
	}
}
ColorRGB sets the foreground color by RGB values.
package glint
import (
	"context"
	"github.com/gookit/color"
)
func Style(inner Component, opts ...StyleOption) Component {
	c := &styleComponent{inner: inner}
	for _, opt := range opts {
		opt(c)
	}
	return c
}
func styleRender(ctx context.Context, v string) string {
	value, _ := ctx.Value(styleCtxKey).([]*styleComponent)
	for _, s := range value {
		v = s.render(v)
	}
	return v
}
type styleComponent struct {
	inner            Component
	fgColor, bgColor colorizer
	style            []color.Color
}
func (c *styleComponent) Body(ctx context.Context) Component {
	old, _ := ctx.Value(styleCtxKey).([]*styleComponent)
	value := make([]*styleComponent, len(old), len(old)+1)
	copy(value, old)
	value = append(value, c)
	return Context(c.inner, styleCtxKey, value)
}
func (c *styleComponent) render(v string) string {
	if c.bgColor != nil {
		v = c.bgColor.Sprint(v)
	}
	if c.fgColor != nil {
		v = c.fgColor.Sprint(v)
	}
	v = color.Style(c.style).Sprint(v)
	return v
}
type styleCtxKeyType struct{}
var styleCtxKey = styleCtxKeyType{}
type StyleOption func(t *styleComponent)
func Color(name string) StyleOption {
	return func(t *styleComponent) {
		if c, ok := color.FgColors[name]; ok {
			t.fgColor = c
		}
		if c, ok := color.ExFgColors[name]; ok {
			t.fgColor = c
		}
	}
}
func ColorHex(v string) StyleOption {
	return func(t *styleComponent) {
		t.fgColor = color.HEX(v)
	}
}