//
// Bright background colors
//
// BgBrightBlack background color (100)
433223
func BgBrightBlack(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgBrightBlack()
	}
	return value{value: arg, color: BrightBg | BlackBg}
}
1170321
func (col Color) RGB255() (r, g, b uint8) {
	r = uint8(col.R*255.0 + 0.5)
	g = uint8(col.G*255.0 + 0.5)
	b = uint8(col.B*255.0 + 0.5)
	return
}
224933
func BgBrightCyan(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgBrightCyan()
	}
	return value{value: arg, color: BrightBg | CyanBg}
}
516181
func (c Color) RGB() (int32, int32, int32) {
	v := c.Hex()
	if v < 0 {
		return -1, -1, -1
	}
	return (v >> 16) & 0xff, (v >> 8) & 0xff, v & 0xff
}
1232255
func BgBrightGreen(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgBrightGreen()
	}
	return value{value: arg, color: BrightBg | GreenBg}
}
608277
func (builder *Builder) FullColorB(r, g, b uint8) *Builder {
	return builder.With(FullColorB(r, g, b))
}
279845
func BrightGreen(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightGreen()
	}
	return value{value: arg, color: BrightFg | GreenFg}
}
209244
func BrightBlack(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightBlack()
	}
	return value{value: arg, color: BrightFg | BlackFg}
}
501532
func NewRGBColor(r, g, b int32) Color {
	return NewHexColor(((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff))
}
941473
func BrightBlue(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightBlue()
	}
	return value{value: arg, color: BrightFg | BlueFg}
}
734510
func (c *Color) Change(color Colors, bg bool) {
	if bg {
		c.Background = color
	} else {
		c.Foreground = color
	}
}
218853
func (w *Waveform) setBGColorFunction(function ColorFunc) error {
	// Function cannot be nil
	if function == nil {
		return errBGColorFunctionNil
	}

	w.bgColorFn = function

	return nil
}
675066
func OptionScrollbarBGColor(x Color) Option {
	return func(p *Prompt) error {
		p.renderer.scrollbarBGColor = x
		return nil
	}
}
510418
func BrightCyan(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightCyan()
	}
	return value{value: arg, color: BrightFg | CyanFg}
}
437927
func NewHighlightRectArgs(x int, y int, width int, height int) *HighlightRectArgs {
	args := new(HighlightRectArgs)
	args.X = x
	args.Y = y
	args.Width = width
	args.Height = height
	return args
}
835121
func (s Style) WithBackground(color Paint) Style {
	newS := s
	newS.bg = color
	newS.code = computeColorCode(newS.bg, newS.fg)
	return newS
}
1207517
func BgBrightWhite(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgBrightWhite()
	}
	return value{value: arg, color: BrightBg | WhiteBg}
}