LampArrayUpdateRequestedEventArgs.SetColorForIndex(Int32, Color) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the lamp corresponding to the index to the desired color.
public:
virtual void SetColorForIndex(int lampIndex, Color desiredColor) = SetColorForIndex;
void SetColorForIndex(int const& lampIndex, Color const& desiredColor);
public void SetColorForIndex(int lampIndex, Color desiredColor);
function setColorForIndex(lampIndex, desiredColor)
Public Sub SetColorForIndex (lampIndex As Integer, desiredColor As Color)
Parameters
- lampIndex
-
Int32
int
The lamp index.
- desiredColor
- Color
The desired color.
Examples
Demonstrates how to control RGB lighting of peripheral devices using the Windows.Devices.Lights and Windows.Devices.Lights.Effects APIs.
Demonstrates how to extract a single, representative color from a desktop screen and use it to illuminate LED lamps on a connected RGB device.
Remarks
If the lamp at the index doesn't support the desired color, it is set to the NearestSupportedColor
If the index does not exist on the device or was not specified in the effect, the call fails silently.
Black is equivalent to a lamp being 'off'.