|
Treehopper C# API
|
An RGB LED connected to three discrete channels of LED driver(s). More...
Public Member Functions | |
| RgbLed (Led red, Led green, Led blue) | |
| Construct a new RGB LED from the specified LED driver channels More... | |
| RgbLed (IList< Led > Leds) | |
| Construct a new RGB LED from a three-item list of LEDs More... | |
| async Task | FlushAsync (bool force=false) |
| Flush this LED's color value to the driver(s) More... | |
| void | SetRgb (float red, float green, float blue) |
| Set the RGB value of this RGB LED More... | |
| void | SetColor (Color color) |
| Set the color of the RGB LED More... | |
| void | SetHsl (float hue, float saturation, float luminance) |
| Set the hue, saturation, and luminance of this RGB LED More... | |
Properties | |
| bool | AutoFlush = true [get, set] |
| Whether calls to SetColor(Color), SetHsl(float, float, float), or SetRgb(float, float, float) should flush to the drivers immediately More... | |
| IFlushable | Parent [get] |
| The parent of this instance. More... | |
| float | RedGain = 1f [get, set] |
| The red gain to use with this RGB LED More... | |
| float | GreenGain = 1f [get, set] |
| The green gain to use with this RGB LED More... | |
| float | BlueGain = 1f [get, set] |
| The blue gain to use with this RGB LED More... | |
An RGB LED connected to three discrete channels of LED driver(s).
Note the RGB LED may be connected across multiple drivers with no impact on functionality. This is common for large arrays of RGB LEDs (which require multiple-of-3 number of channels) interfacing with multiple 8-, 16-, or 24-channel drivers.
Construct a new RGB LED from the specified LED driver channels
| red | The red LED |
| green | The green LED |
| blue | The blue LED |
| async Task FlushAsync | ( | bool | force = false | ) |
Flush this LED's color value to the driver(s)
| force | Whether to force an update |
Implements IFlushable.
| void SetRgb | ( | float | red, |
| float | green, | ||
| float | blue | ||
| ) |
Set the RGB value of this RGB LED
| red | The red intensity, from 0-255 |
| green | The green intensity, from 0-255 |
| blue | The blue intensity, from 0-255 |
| void SetColor | ( | Color | color | ) |
Set the color of the RGB LED
| color | The desired color |
| void SetHsl | ( | float | hue, |
| float | saturation, | ||
| float | luminance | ||
| ) |
Set the hue, saturation, and luminance of this RGB LED
| hue | The hue, from 0-360 degrees, of the desired color |
| saturation | The saturation, from 0-100, of the desired color |
| luminance | The luminance, from 0-100, of the desired color |
|
getset |
Whether calls to SetColor(Color), SetHsl(float, float, float), or SetRgb(float, float, float) should flush to the drivers immediately
|
get |
The parent of this instance.
Unused.
|
getset |
The red gain to use with this RGB LED
|
getset |
The green gain to use with this RGB LED
|
getset |
The blue gain to use with this RGB LED