// BgWhite background color (47)
545341
func BgWhite(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgWhite()
	}
	return value{value: arg, color: WhiteBg}
}
374826
func BgBrightMagenta(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgBrightMagenta()
	}
	return value{value: arg, color: BrightBg | MagentaBg}
}
500870
func BlendBgColor(dest *Image, c color.Color) {
	r := dest.Bounds()
	cr32, cg32, cb32, _ := c.RGBA()
	cr, cg, cb := uint8(cr32), uint8(cg32), uint8(cb32)

	var bgra BGRA
	var alpha float64
	for x := r.Min.X; x < r.Max.X; x++ {
		for y := r.Min.Y; y < r.Max.Y; y++ {
			bgra = dest.At(x, y).(BGRA)
			alpha = float64(bgra.A) / 255.0
			dest.SetBGRA(x, y, BGRA{
				B: blend(cb, bgra.B, alpha),
				G: blend(cg, bgra.G, alpha),
				R: blend(cr, bgra.R, alpha),
				A: 0xff,
			})
		}
	}
}
857870
func (col Color) XyyWhiteRef(wref [3]float64) (x, y, Y float64) {
	X, Y2, Z := col.Xyz()
	return XyzToXyyWhiteRef(X, Y2, Z, wref)
}
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
}
431551
func NewColour(r, g, b uint8) Colour {
	return ParseColour(fmt.Sprintf("%02x%02x%02x", r, g, b))
}
367199
func OptionSelectedSuggestionBGColor(x Color) Option {
	return func(p *Prompt) error {
		p.renderer.selectedSuggestionBGColor = x
		return nil
	}
}
1327756
func (c Color) RGBA() (r, g, b, a uint32) {
	fa := float64(c.A) / 255.0
	r = uint32(float64(uint32(c.R)) * fa)
	r |= r << 8
	g = uint32(float64(uint32(c.G)) * fa)
	g |= g << 8
	b = uint32(float64(uint32(c.B)) * fa)
	b |= b << 8
	a = uint32(c.A)
	a |= a << 8
	return
}
414868
func NewStyle(background, foreground Paint) Style {
	bg := background
	fg := foreground
	return Style{
		bg,
		fg,
		computeColorCode(bg, fg),
	}
}
1343437
func ColorToRGB(colorVal int) color.RGBA {

	red := colorVal >> 16
	green := (colorVal & 0x00FF00) >> 8
	blue := colorVal & 0x0000FF

	return color.RGBA{
		R: uint8(red),
		G: uint8(green),
		B: uint8(blue),
		A: uint8(255),
	}
}
1046312
func (c *Checkbox) SetFieldBackgroundColor(color tcell.Color) *Checkbox {
	c.fieldBackgroundColor = color
	return c
}
95118
func (d *domainClient) GetBackgroundColors(ctx context.Context, args *GetBackgroundColorsArgs) (reply *GetBackgroundColorsReply, err error) {
	reply = new(GetBackgroundColorsReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "CSS.getBackgroundColors", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "CSS.getBackgroundColors", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "CSS", Op: "GetBackgroundColors", Err: err}
	}
	return
}
742418
func TrueColorFromRGB(r byte, g byte, b byte) TrueColor {
	return TrueColor(((uint(r) & 0xff) << 16) | ((uint(g) & 0xff) << 8) | (uint(b) & 0xff))
}
250336
func ThemeColor(baseColor string, tint float64) string {
	if tint == 0 {
		return "FF" + baseColor
	}
	r, _ := strconv.ParseInt(baseColor[0:2], 16, 64)
	g, _ := strconv.ParseInt(baseColor[2:4], 16, 64)
	b, _ := strconv.ParseInt(baseColor[4:6], 16, 64)
	h, s, l := RGBToHSL(uint8(r), uint8(g), uint8(b))
	if tint < 0 {
		l *= (1 + tint)
	} else {
		l = l*(1-tint) + (1 - (1 - tint))
	}
	br, bg, bb := HSLToRGB(h, s, l)
	return fmt.Sprintf("FF%02X%02X%02X", br, bg, bb)
}
610056
func (c *Context) BlendColor(r, g, b, a float64) {
	c.Call("blendColor", r, g, b, a)
}
1041343
func getColorFromBsdCode(code string) string {
	colorForeground := code[0]
	colorBackground := code[1]

	var colorBytes bytes.Buffer
	colorBytes.WriteString("\x1b[")
	colorBytes.WriteString(getPartialColor(true, colorForeground))
	colorBytes.WriteString(getPartialColor(false, colorBackground))
	colorBytes.WriteString("m")

	return colorBytes.String()
}
829032
func (builder *Builder) Color3BitB(c RGB3Bit) *Builder {
	return builder.With(Color3BitB(c))
}