func ColorRead(buf []byte, v *Color) int {
	b := 0
	v.Red = xgb.Get16(buf[b:])
	b += 2
	v.Green = xgb.Get16(buf[b:])
	b += 2
	v.Blue = xgb.Get16(buf[b:])
	b += 2
	v.Alpha = xgb.Get16(buf[b:])
	b += 2
	return b
}
ColorRead reads a byte slice into a Color value.
package render
import (
	"github.com/BurntSushi/xgb"
	"github.com/BurntSushi/xgb/xproto"
)
func Init(c *xgb.Conn) error {
	reply, err := xproto.QueryExtension(c, 6, "RENDER").Reply()
	switch {
	case err != nil:
		return err
	case !reply.Present:
		return xgb.Errorf("No extension named RENDER could be found on on the server.")
	}
	c.ExtLock.Lock()
	c.Extensions["RENDER"] = reply.MajorOpcode
	c.ExtLock.Unlock()
	for evNum, fun := range xgb.NewExtEventFuncs["RENDER"] {
		xgb.NewEventFuncs[int(reply.FirstEvent)+evNum] = fun
	}
	for errNum, fun := range xgb.NewExtErrorFuncs["RENDER"] {
		xgb.NewErrorFuncs[int(reply.FirstError)+errNum] = fun
	}
	return nil
}
func init() {
	xgb.NewExtEventFuncs["RENDER"] = make(map[int]xgb.NewEventFun)
	xgb.NewExtErrorFuncs["RENDER"] = make(map[int]xgb.NewErrorFun)
}
type Animcursorelt struct {
	Cursor xproto.Cursor
	Delay  uint32
}
func AnimcursoreltRead(buf []byte, v *Animcursorelt) int {
	b := 0
	v.Cursor = xproto.Cursor(xgb.Get32(buf[b:]))
	b += 4
	v.Delay = xgb.Get32(buf[b:])
	b += 4
	return b
}
func AnimcursoreltReadList(buf []byte, dest []Animcursorelt) int {
	b := 0
	for i := 0; i < len(dest); i++ {
		dest[i] = Animcursorelt{}
		b += AnimcursoreltRead(buf[b:], &dest[i])
	}
	return xgb.Pad(b)
}
func (v Animcursorelt) Bytes() []byte {
	buf := make([]byte, 8)
	b := 0
	xgb.Put32(buf[b:], uint32(v.Cursor))
	b += 4
	xgb.Put32(buf[b:], v.Delay)
	b += 4
	return buf[:b]
}
func AnimcursoreltListBytes(buf []byte, list []Animcursorelt) int {
	b := 0
	var structBytes []byte
	for _, item := range list {
		structBytes = item.Bytes()
		copy(buf[b:], structBytes)
		b += len(structBytes)
	}
	return xgb.Pad(b)
}
type Color struct {
	Red   uint16
	Green uint16
	Blue  uint16
	Alpha uint16
}