-
Notifications
You must be signed in to change notification settings - Fork 18
Understanding CUE.NET ledgroups
Ledgroups are one of the basic features of CUE.NET.
They are used to group multiple LEDs together and apply brushes and effects to them.
By the default every device itself acts as a ledgroup containing all it's LEDs. Since the device-ledgroup is always handled first on updates it's especially useful to add a background.
Every ledgroup implements the ILedGroup-interface:
public interface ILedGroup : IEffectTarget<ILedGroup>
{
IBrush Brush { get; set; }
int ZIndex { get; set; }
IEnumerable<CorsairLed> GetLeds();
}
The LEDs the group is containing are returned by the GetLeds-method. You are also able to set the brush of the group through the Brush-property. To specify in which order groups are handled on updates, you can use the ZIndex-property. It defaults to 0, lower values will be handled first.
In addition to that, a ledgroup is always qualified to be targeted by effects since it's marked with the IEffectTarget-interface.
If you plan to implement your own ledgroup you should derive the AbstractLedGroup-class. Everything (including everything effect related) except the calculation of contained LEDs will be handled there.
CUE.NET currently provides two ledgroups to work with:
The ListLedGroup is designed to contain arbitrary LEDs. You can add or remove LEDs and check if a LED is contained by using the respective methods AddLed, RemoveLed and ContainsLed.
You can also merge any other ledgroups by calling the MergeLeds-method
This ledgroup calculates the contained LEDs by laying the specified rectangle over the device (this is only useful for keyboards) and include every LED which intersects with a higher percentage than specified in the MinOverlayPercentage-property [0.5 by default].
If there are LEDs inside this rectangle you don't want to include, you can call the exclude-extension method afterwards which returns the respective ListLedGroup.
Please drop me a message if you find mistakes or inadequate descriptions in one of the pages here!
-
Introduction
1.1. What is CUE.NET?
1.2. What can I do with CUE.NET?
1.3. Projects using CUE.NET -
Getting started
2.1. Adding CUE.NET to a project
2.2. Initializing CUE.NET
2.3. Perform basic lighting
2.4. Understanding CUE.NET ledgroups -
Gradients
3.1. Understanding CUE.NET gradients
3.2. Linear Gradient
3.3. Rainbow Gradient
3.4. Implementing an own gradient -
Brushes
4.1. Understanding CUE.NET brushes
4.2. Color-Corrections
4.3. Solid-Color Brush
4.4. Linear-Gradient Brush
4.5. Radial-Gradient Brush
4.6. Random-Color Brush
4.7. Image-Brush
4.8. Implementing an own brush -
Effects
5.1. Understanding CUE.NET effects
5.2. Flash Effect
5.3. Move-Gradient Effect
5.4. Implementing an own effect -
Tutorials