void SetKeyPosition(TesoroLedID key, int x, int y) { if ((x >= width) || (y >= height)) { // out of bounds return; } keyPositions[x, y] = key; }
/// <summary> /// Sets the LED of a single key using 0-255 integers. /// </summary> /// <param name="key"></param> /// <param name="r">Red exponent 0-255</param> /// <param name="g">Green exponent 0-255</param> /// <param name="b">Blue exponent 0-255</param> /// <param name="profile">The profile to modify. This should be the active profile.</param> public void SetKeyColor(TesoroLedID key, int r, int g, int b, TesoroProfile profile) { if (key == TesoroLedID.None) { return; } // Prepare the command data byte[] data = { 0x07, 0x0D, (byte)profile, (byte)key, IntToByte(r), IntToByte(g), IntToByte(b), 0x00 }; // Send the data device.writeFeature(data); }