CherryRGB

Usage

Find usb keyboard and initialize it

```rs // Optionally, filter for product id if you have more than one cherry device. let devices = cherryrgb::finddevices(Some(0x00dd)).unwrap(); let (vendorid, productid) = devices.first().unwrap().toowned(); let devicehandle = cherryrgb::initdevice(vendorid, productid).unwrap()

cherryrgb::fetchdevicestate(&device_handle).unwrap(); ```

Set LED animation

```rs // Create color: green let color = cherryrgb::RGB8::new(0, 0xff, 0); let userainbowcolors: bool = false;

cherryrgb::setledanimation( &devicehandle, cherryrgb::LightingMode::Rain, cherryrgb::Brightness::Full, cherryrgb::Speed::Slow, color, userainbow_colors, ) .unwrap(); ```

Set custom colors ```rs // Reset all colors first cherryrgb::resetcustomcolors(&device_handle).unwrap();

// Create color: green let color = cherryrgb::RGB8::new(0, 0xff, 0);

// Create keys struct and set key with index 42 to desired color let mut keys = cherryrgb::CustomKeyLeds::new(); keys.set_led(42, color.into()).unwrap();

// Send packets to keyboard cherryrgb::setcustomcolors(&device_handle, keys).unwrap(); ```