Versions in this module Expand all Collapse all v0 v0.0.1 Oct 27, 2023 Changes in this version + var ColorApricot = color.RGBA + var ColorBeige = color.RGBA + var ColorBlack = color.RGBA + var ColorBlue = color.RGBA + var ColorBronze = color.RGBA + var ColorBrown = color.RGBA + var ColorCyan = color.RGBA + var ColorGold = color.RGBA + var ColorGray = color.RGBA + var ColorGreen = color.RGBA + var ColorIndigo = color.RGBA + var ColorLavender = color.RGBA + var ColorLime = color.RGBA + var ColorMagenta = color.RGBA + var ColorMaroon = color.RGBA + var ColorMint = color.RGBA + var ColorNavy = color.RGBA + var ColorOlive = color.RGBA + var ColorOrange = color.RGBA + var ColorPeach = color.RGBA + var ColorPink = color.RGBA + var ColorPlum = color.RGBA + var ColorPurple = color.RGBA + var ColorRed = color.RGBA + var ColorScarlet = color.RGBA + var ColorSilver = color.RGBA + var ColorTeal = color.RGBA + var ColorViolet = color.RGBA + var ColorWhite = color.RGBA + var ColorYellow = color.RGBA + var RainbowColors = []color.Color + func ColorToHex(cl color.Color) string + func ColorToRGB(cl color.Color) (r, g, b uint8) + func DecodeGammaColor(cl color.Color) color.Color + func EncodeGammaColor(cl color.Color) color.Color + func FindDeviceInfoBySerialNumber(sn string) (*hid.DeviceInfo, error) + func FindNextDeviceInfo() (di *hid.DeviceInfo, err error) + func GetColorByName(name string) (cl color.Color, found bool) + func GetColorNames() []string + func GetNameByColor(cl color.Color) (name string, found bool) + func GetNameOrHexByColor(cl color.Color) string + func HSBToRGB(hue, sat, bright float64) (red, green, blue uint8) + func HexToColor(hex string) (color.Color, error) + func HexToRGB(hex string) (r, g, b uint8, err error) + func IsBlink1Device(di *hid.DeviceInfo) bool + func IsRunningOnSupportedOS() bool + func ListDeviceInfo() []*hid.DeviceInfo + func ParseColor(query string) (color.Color, error) + func ParseRepeatTimes(query string) (uint, error) + func ParseTitle(query string) (string, error) + func Preload() + func RGBToColor(r, g, b uint8) color.Color + func RGBToHex(r, g, b uint8) string + func RandomColor() color.Color + type Controller struct + func NewController(dev *Device) *Controller + func OpenController(info *hid.DeviceInfo) (*Controller, error) + func OpenControllerBySerialNumber(sn string) (*Controller, error) + func OpenNextController() (*Controller, error) + func (c *Controller) Close() + func (c *Controller) GetDevice() *Device + func (c *Controller) GetFirmwareVersion() (int, error) + func (c *Controller) GetPatternState() (PatternState, error) + func (c *Controller) IsPatternPlaying() (bool, error) + func (c *Controller) LoadPattern(posStart, posEnd uint, seq StateSequence) error + func (c *Controller) PlayColor(cl color.Color) error + func (c *Controller) PlayHSB(hue, saturation, brightness float64) error + func (c *Controller) PlayPattern(pt Pattern) error + func (c *Controller) PlayPatternBlocking(pt Pattern) error + func (c *Controller) PlayRGB(r, g, b byte) error + func (c *Controller) PlayState(st LightState) error + func (c *Controller) PlayStateBlocking(st LightState) error + func (c *Controller) ReadColor(ledN LEDIndex) (color.Color, error) + func (c *Controller) ReadPattern() (StateSequence, error) + func (c *Controller) SetGammaCorrection(on bool) + func (c *Controller) SimpleTickle(posStart, posEnd uint, timeout time.Duration, keepOld bool) error + func (c *Controller) StartAutoTickle(posStart, posEnd uint, keepOld bool) error + func (c *Controller) StartManualTickle(posStart, posEnd uint, timeout time.Duration, keepOld bool) (chan<- struct{}, error) + func (c *Controller) StopAutoTickle() + func (c *Controller) StopPlaying() error + func (c *Controller) String() string + func (c *Controller) WritePattern() error + type Device struct + func OpenDevice(info *hid.DeviceInfo) (*Device, error) + func OpenDeviceBySerialNumber(sn string) (*Device, error) + func OpenNextDevice() (*Device, error) + func (b1 *Device) Close() + func (b1 *Device) FadeToRGB(r, g, b byte, fadeMsec uint, ledN LEDIndex) error + func (b1 *Device) GetDeviceInfo() *hid.DeviceInfo + func (b1 *Device) GetGeneration() uint16 + func (b1 *Device) GetProductName() string + func (b1 *Device) GetSerialNumber() string + func (b1 *Device) GetVersion() (ver int, err error) + func (b1 *Device) PlayLoop(play bool, posStart, posEnd, times uint) error + func (b1 *Device) ReadPatternLine(pos uint) (st DeviceLightState, err error) + func (b1 *Device) ReadPlaystate() (st DevicePatternState, err error) + func (b1 *Device) ReadRGB(ledN LEDIndex) (r, g, b byte, err error) + func (b1 *Device) SavePattern() error + func (b1 *Device) SetPatternLine(pos uint, st DeviceLightState) error + func (b1 *Device) SetRGBNow(r, g, b byte, ledN LEDIndex) error + func (b1 *Device) SetTickleMode(play, keep bool, posStart, posEnd, timeoutMsec uint) error + func (b1 *Device) String() string + func (b1 *Device) Test() ([]byte, error) + type DeviceLightState struct + B byte + FadeTimeMsec uint + G byte + LED LEDIndex + R byte + func (st DeviceLightState) String() string + type DevicePatternState struct + CurrentPos uint + IsPlaying bool + LoopEndPos uint + LoopStartPos uint + RepeatTimes uint + func (st DevicePatternState) String() string + type LEDIndex byte + const LED1 + const LED2 + const LEDAll + func (l LEDIndex) String() string + func (l LEDIndex) ToByte() byte + type LightState struct + Color color.Color + FadeTime time.Duration + LED LEDIndex + func NewLightState(cl color.Color, fadeTime time.Duration, ledN LEDIndex) LightState + func NewLightStateHSB(h, s, b float64, fadeTime time.Duration, ledN LEDIndex) LightState + func NewLightStateRGB(r, g, b uint8, fadeTime time.Duration, ledN LEDIndex) LightState + func ParseStateQuery(query string) (LightState, error) + func (st *LightState) UnmarshalText(text []byte) error + func (st LightState) MarshalText() (text []byte, err error) + func (st LightState) String() string + type Pattern struct + EndPosition uint + RepeatTimes uint + Sequence StateSequence + StartPosition uint + func (p Pattern) String() string + type PatternState struct + CurrentPosition uint + EndPosition uint + IsPlaying bool + RepeatTimes uint + StartPosition uint + func (st PatternState) String() string + type StateSequence []LightState + func (seq *StateSequence) UnmarshalText(text []byte) error + func (seq StateSequence) Length() int + func (seq StateSequence) MarshalText() (text []byte, err error) + func (seq StateSequence) String() string + func (seq StateSequence) TotalTime() time.Duration