func (s *simpleHidDevice) SetColor(c color.Color) error {
	if s.device != nil {
		return s.setColorFn(s.device, c)
	}
	return ErrDeviceClosed
}
SetColor sets the color of the LED to the closest supported color.
package led
import (
	"errors"
	"github.com/boombuler/hid"
	"image/color"
)
type simpleHidDevice struct {
	device     hid.Device
	keepAlive  bool
	setColorFn func(d hid.Device, c color.Color) error
}
var ErrDeviceClosed = errors.New("Device is already closed")
func (s *simpleHidDevice) SetKeepActive(v bool) error {
	if s.device != nil {
		s.keepAlive = v
		return nil
	}
	return ErrDeviceClosed
}
func (s *simpleHidDevice) Close() {
	if s.device != nil {
		if !s.keepAlive {
			s.SetColor(color.Black)
		}
		s.device.Close()
		s.device = nil
	}
}