1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-13 00:58:31 +00:00

Updated Perform basic lighting (markdown)

DarthAffe 2017-01-08 15:36:08 +01:00
parent 9c7a8e83a7
commit ec3ce4522e

@ -5,6 +5,7 @@ Especially on keyboards you might run into a lot of trouble mixing direct lighti
> It's not that difficult or take that much extra work as you might think now!
Direct lighting of a key can be achieved by getting the LED you want to color through one of the indexers from the SDK. (The one connected to the device you want to control.)
This code would set the color of the A-key on your keyboard to red and the color of the B-key to green. After that it would set the B1-LED (location depends on the device) to blue.
All other keys would keep the color they had before:
```C#
@ -36,6 +37,7 @@ CueSDK.UpdateFrequency = 1f/60f;
### CorsairColor
Inside of CUE.NET colors are represented as a own class called [CorsairColor](https://github.com/DarthAffe/CUE.NET/blob/master/Devices/Generic/CorsairColor.cs).
This allows colors to be reference and processed in an advanced way. To keep things simple when working with CUE.NET any _CorsairColor_ is implicit convertible to and from System.Drawing.Color.
> CorsairColors are unlike System.Draw.Colors reference-types. Keep that in mind when modifying a color that might be used multiple times!
You can copy any color by simply creating a new one and pass the old as a parameter to the constructor.