public void GKeyMimicLightState(keyboardNames key, LightState state) { if (state != null && state.on) { // Scale hue, sat, brightness double H = state.hue * (360.0 / 65535); double S = state.sat * (1.0 / 254); double L = state.bri * (1.0 / 254); LogitechLEDGSDK.LogiLedSetLightingForKeyWithKeyName(key, HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.R), HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.G), HueHSLtoRGBPercent(H, S, L, (int)RBGnVal.B)); } else { LogitechLEDGSDK.LogiLedSetLightingForKeyWithKeyName(key, 0, 0, 0); } }