private void SendColorToPeripheral(Color color, bool forced = false) { if ((!previous_peripheral_Color.Equals(color) || forced)) { if (Global.Configuration.allow_peripheral_devices) { //Apply and strip Alpha color = Color.FromArgb(255, Utils.ColorUtils.MultiplyColorByScalar(color, color.A / 255.0D)); if (mouse != null && !Global.Configuration.devices_disable_mouse) { if (mouse[CorsairLedId.B1] != null) { mouse[CorsairLedId.B1].Color = color; } if (mouse[CorsairLedId.B2] != null) { mouse[CorsairLedId.B2].Color = color; } if (mouse[CorsairLedId.B3] != null) { mouse[CorsairLedId.B3].Color = color; } if (mouse[CorsairLedId.B4] != null) { mouse[CorsairLedId.B4].Color = color; } if (mouse[CorsairLedId.B5] != null) { mouse[CorsairLedId.B5].Color = color; } if (mouse[CorsairLedId.B6] != null) { mouse[CorsairLedId.B6].Color = color; } mouse.Update(true); } if (headset != null && !Global.Configuration.devices_disable_headset) { if (headset[CorsairLedId.LeftLogo] != null) { headset[CorsairLedId.LeftLogo].Color = color; } if (headset[CorsairLedId.RightLogo] != null) { headset[CorsairLedId.RightLogo].Color = color; } headset.Update(true); } /* if (mousemat != null && !Global.Configuration.devices_disable_mouse) * { * if (mousemat[CorsairLedId.Zone1] != null) * mousemat[CorsairLedId.Zone1].Color = color; * if (mousemat[CorsairLedId.Zone2] != null) * mousemat[CorsairLedId.Zone2].Color = color; * if (mousemat[CorsairLedId.Zone3] != null) * mousemat[CorsairLedId.Zone3].Color = color; * if (mousemat[CorsairLedId.Zone4] != null) * mousemat[CorsairLedId.Zone4].Color = color; * if (mousemat[CorsairLedId.Zone5] != null) * mousemat[CorsairLedId.Zone5].Color = color; * if (mousemat[CorsairLedId.Zone6] != null) * mousemat[CorsairLedId.Zone6].Color = color; * if (mousemat[CorsairLedId.Zone7] != null) * mousemat[CorsairLedId.Zone7].Color = color; * if (mousemat[CorsairLedId.Zone8] != null) * mousemat[CorsairLedId.Zone8].Color = color; * if (mousemat[CorsairLedId.Zone9] != null) * mousemat[CorsairLedId.Zone9].Color = color; * if (mousemat[CorsairLedId.Zone10] != null) * mousemat[CorsairLedId.Zone10].Color = color; * if (mousemat[CorsairLedId.Zone11] != null) * mousemat[CorsairLedId.Zone11].Color = color; * if (mousemat[CorsairLedId.Zone12] != null) * mousemat[CorsairLedId.Zone12].Color = color; * if (mousemat[CorsairLedId.Zone13] != null) * mousemat[CorsairLedId.Zone13].Color = color; * if (mousemat[CorsairLedId.Zone14] != null) * mousemat[CorsairLedId.Zone14].Color = color; * if (mousemat[CorsairLedId.Zone15] != null) * mousemat[CorsairLedId.Zone15].Color = color; * * mousemat.Update(true); * }*/ if (headsetstand != null && !Global.Configuration.devices_disable_headset) { if (headsetstand[CorsairLedId.HeadsetStandZone1] != null) { headsetstand[CorsairLedId.HeadsetStandZone1].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone2] != null) { headsetstand[CorsairLedId.HeadsetStandZone2].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone3] != null) { headsetstand[CorsairLedId.HeadsetStandZone3].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone4] != null) { headsetstand[CorsairLedId.HeadsetStandZone4].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone5] != null) { headsetstand[CorsairLedId.HeadsetStandZone5].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone6] != null) { headsetstand[CorsairLedId.HeadsetStandZone6].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone7] != null) { headsetstand[CorsairLedId.HeadsetStandZone7].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone8] != null) { headsetstand[CorsairLedId.HeadsetStandZone8].Color = color; } if (headsetstand[CorsairLedId.HeadsetStandZone9] != null) { headsetstand[CorsairLedId.HeadsetStandZone9].Color = color; } headsetstand.Update(true); } previous_peripheral_Color = color; peripheral_updated = true; } else { if (peripheral_updated) { peripheral_updated = false; } } } }