func dealExtremeSetColor(d hid.Device, c color.Color) error { palette := color.Palette{ color.RGBA{0x00, 0x00, 0x00, 0x00}, color.RGBA{0x00, 0xff, 0x00, 0xff}, color.RGBA{0xff, 0x00, 0x00, 0xff}, color.RGBA{0x00, 0x00, 0xff, 0xff}, color.RGBA{0x00, 0xff, 0xff, 0xff}, color.RGBA{0x00, 0xff, 0xff, 0xff}, color.RGBA{0xff, 0xff, 0x00, 0xff}, color.RGBA{0xff, 0x00, 0xff, 0xff}, color.RGBA{0xff, 0xff, 0xff, 0xff}, } return d.Write([]byte{0x00, byte(palette.Index(c))}) }
func blyncDevSetColor(d hid.Device, c color.Color) error { palette := color.Palette{ color.RGBA{0x00, 0x00, 0x00, 0x00}, // black color.RGBA{0xff, 0xff, 0xff, 0xff}, // white color.RGBA{0x00, 0xff, 0xff, 0xff}, // cyan color.RGBA{0xff, 0x00, 0xff, 0xff}, // magenta color.RGBA{0x00, 0x00, 0xff, 0xff}, // blue color.RGBA{0xff, 0xff, 0x00, 0xff}, // yellow color.RGBA{0x00, 0xff, 0x00, 0xff}, // lime color.RGBA{0xff, 0x00, 0x00, 0xff}, // red } value := byte((palette.Index(c) * 16) + 127) return d.Write([]byte{0x00, 0x55, 0x53, 0x42, 0x43, 0x00, 0x40, 0x02, value}) }
func dreamCheekyDevSetColor(d hid.Device, c color.Color) error { r, g, b, _ := c.RGBA() return d.Write([]byte{0x00, byte(r >> 10), byte(g >> 10), byte(b >> 10), 0x00, 0x00, 0x54, 0x2C, 0x05}) }