// Color returns the Color property of the i-th vertex.
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),
	}
}
503396
func (w *Wrapper) PrintColor(ctx *ansiterm.Context, value interface{}) {
	if ctx != nil {
		ctx.Fprintf(w.TabWriter, "%v\t", value)
	} else {
		fmt.Fprintf(w, "%v\t", value)
	}
}
1338448
func (c *Color) Add(value ...Attribute) *Color {
	c.params = append(c.params, value...)
	return c
}
291514
func Color(s, style string) string {
	if plain || len(style) < 1 {
		return s
	}
	buf := colorCode(style)
	buf.WriteString(s)
	buf.WriteString(Reset)
	return buf.String()
}
354811
func (a *Writer) BColor256(color int) (int, error) {
	return a.WriteString(BColor256(color))
}
144797
func (gf *GLFrame) Color(at pixel.Vec) pixel.RGBA {
	if gf.dirty {
		mainthread.Call(func() {
			tex := gf.frame.Texture()
			tex.Begin()
			gf.pixels = tex.Pixels(0, 0, tex.Width(), tex.Height())
			tex.End()
		})
		gf.dirty = false
	}
	if !gf.bounds.Contains(at) {
		return pixel.Alpha(0)
	}
	bx, by, bw, _ := intBounds(gf.bounds)
	x, y := int(at.X)-bx, int(at.Y)-by
	off := y*bw + x
	return pixel.RGBA{
		R: float64(gf.pixels[off*4+0]) / 255,
		G: float64(gf.pixels[off*4+1]) / 255,
		B: float64(gf.pixels[off*4+2]) / 255,
		A: float64(gf.pixels[off*4+3]) / 255,
	}
}
706762
func (s Style) Background(c Color) Style {
	if c == ColorDefault {
		return (s &^ (0x1ffffff | styleBgSet))
	}
	return (s &^ (0x1ffffff)) | (Style(c) & 0x1ffffff) | styleBgSet
}
121077
func (writer *ConsoleWriter) Colored() bool {
	writer.lock.RLock()
	defer writer.lock.RUnlock()

	return writer.colored
}
1285101
func SetColor(tag string, cl *color.Color) {
	privateMutex.Lock()
	defer privateMutex.Unlock()
	// add new theme
	Theme[tag] = cl
}
1340822
func (c Color) Hex() int32 {
	if c&ColorIsRGB != 0 {
		return (int32(c) & 0xffffff)
	}
	if v, ok := ColorValues[c]; ok {
		return v
	}
	return -1
}
974030
func (color TrueColor) Rgb() (byte, byte, byte) {
	return byte((color >> 16) & 0xFF), byte((color >> 8) & 0xFF), byte(color & 0xFF)
}
627010
func (c *Context) ClearColor(r, g, b, a float32) {
	c.Call("clearColor", r, g, b, a)
}
999541
func GetPixelColor(x, y int) string {
	cx := C.size_t(x)
	cy := C.size_t(y)

	color := C.get_pixel_color(cx, cy)
	gcolor := C.GoString(color)
	C.free(unsafe.Pointer(color))

	return gcolor
}
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
}
1319649
func (g *Graph) Vertices() []Vertex {
	list := g.vertices.List()
	result := make([]Vertex, len(list))
	for i, v := range list {
		result[i] = v.(Vertex)
	}

	return result
}
1226411
func (b *BlinkMDriver) Color() (color []byte, err error) {
	if _, err = b.connection.Write([]byte("g")); err != nil {
		return
	}
	data := []byte{0, 0, 0}
	read, err := b.connection.Read(data)
	if read != 3 || err != nil {
		return []byte{}, err
	}
	return []byte{data[0], data[1], data[2]}, nil
}
300656
func New(value ...Attribute) *Color {
	c := &Color{params: make([]Attribute, 0)}
	c.Add(value...)
	return c
}