/// <summary> /// Sets the color of a specific LED on the mouse. /// </summary> /// <param name="led">Which LED to modify.</param> /// <param name="color">Color to set.</param> /// <param name="clear">If <c>true</c>, the mouse will first be cleared before setting the LED.</param> public void SetLed(Led led, Color color, bool clear = false) { if (clear) { _custom.Clear(); // Clear the grid effect as well, this way the mouse // will behave slightly more predictable for the caller. _customGrid.Clear(); } _custom[led] = color; SetCustom(_custom); }
/// <summary> /// Sets the color on a specific row and column on the keyboard grid. /// </summary> /// <param name="row">Row to set, between 0 and <see cref="Constants.MaxRows" /> (exclusive upper-bound).</param> /// <param name="column">Column to set, between 0 and <see cref="Constants.MaxColumns" /> (exclusive upper-bound).</param> /// <param name="color">Color to set.</param> /// <param name="clear">Whether or not to clear the existing colors before setting this one.</param> /// <exception cref="ArgumentException">Thrown if the row or column parameters are outside the valid ranges.</exception> public void Set(Size row, Size column, Color color, bool clear = false) { if (clear) { // ReSharper disable once ImpureMethodCallOnReadonlyValueField _grid.Clear(); } _grid[(int)row, (int)column] = color; Set(_grid); }