// Rgb sets color using r,g,b params
343841
func (b *BlinkMDriver) Rgb(red byte, green byte, blue byte) (err error) {
	if _, err = b.connection.Write([]byte("n")); err != nil {
		return
	}
	_, err = b.connection.Write([]byte{red, green, blue})
	return
}
1298485
func (builder *Builder) Color3BitF(c RGB3Bit) *Builder {
	return builder.With(Color3BitF(c))
}
880468
func Color(value string) *trees.Style {
	return &trees.Style{Name: "color", Value: value}
}
182587
func (pd *PictureData) Color(at Vec) RGBA {
	if !pd.Rect.Contains(at) {
		return RGBA{0, 0, 0, 0}
	}
	return ToRGBA(pd.Pix[pd.Index(at)])
}
945292
func ColorFromAlphaMixedRGBA(r, g, b, a uint32) Color {
	fa := float64(a) / 255.0
	var c Color
	c.R = uint8(float64(r) / fa)
	c.G = uint8(float64(g) / fa)
	c.B = uint8(float64(b) / fa)
	c.A = uint8(a | (a >> 8))
	return c
}
431551
func NewColour(r, g, b uint8) Colour {
	return ParseColour(fmt.Sprintf("%02x%02x%02x", r, g, b))
}
501532
func NewRGBColor(r, g, b int32) Color {
	return NewHexColor(((r & 0xff) << 16) | ((g & 0xff) << 8) | (b & 0xff))
}
6587
func (w *Waveform) SetBGColorFunction(function ColorFunc) error {
	return w.SetOptions(BGColorFunction(function))
}
1005785
func OptionSuggestionBGColor(x Color) Option {
	return func(p *Prompt) error {
		p.renderer.suggestionBGColor = x
		return nil
	}
}
511643
func gradient(from, to color.RGBA, scale float64) (result color.RGBA) {
	scale = math.Max(math.Min(scale, 1.0), 0.0)
	result.R = linearScale(from.R, to.R, scale)
	result.G = linearScale(from.G, to.G, scale)
	result.B = linearScale(from.B, to.B, scale)
	return
}
35825
func OptionInputBGColor(x Color) Option {
	return func(p *Prompt) error {
		p.renderer.inputBGColor = x
		return nil
	}
}
1200365
func GetColor(bitmap C.MMBitmapRef, x, y int) C.MMRGBHex {
	color := C.bitmap_get_color(bitmap, C.size_t(x), C.size_t(y))

	return color
}
493856
func (gt *GLTriangles) Color(i int) pixel.RGBA {
	r := gt.data[i*gt.vs.Stride()+2]
	g := gt.data[i*gt.vs.Stride()+3]
	b := gt.data[i*gt.vs.Stride()+4]
	a := gt.data[i*gt.vs.Stride()+5]
	return pixel.RGBA{
		R: float64(r),
		G: float64(g),
		B: float64(b),
		A: float64(a),
	}
}
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),
	}
}
566234
func (a *SetDefaultBackgroundColorOverrideArgs) SetColor(color dom.RGBA) *SetDefaultBackgroundColorOverrideArgs {
	a.Color = &color
	return a
}
1340822
func (c Color) Hex() int32 {
	if c&ColorIsRGB != 0 {
		return (int32(c) & 0xffffff)
	}
	if v, ok := ColorValues[c]; ok {
		return v
	}
	return -1
}
825355
func (c1 Color) BlendRgb(c2 Color, t float64) Color {
	return Color{c1.R + t*(c2.R-c1.R),
		c1.G + t*(c2.G-c1.G),
		c1.B + t*(c2.B-c1.B)}
}