-api-id | -api-type | ms.custom |
---|---|---|
M:Windows.Devices.Lights.LampArray.SetColorForIndex(System.Int32,Windows.UI.Color) |
winrt method |
RS5 |
Sets the lamp corresponding to the index to the desired color.
The lamp index.
The desired color.
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, the call fails silently.
Black is equivalent to a lamp being 'off'.
:::row::: :::column:::
[LampArray sample](https://github.com/microsoft/Windows-universal-samples/tree/main/Samples/LampArray)
Demonstrates how to control RGB lighting of peripheral devices using the [**Windows.Devices.Lights**](/uwp/api/windows.devices.lights) and [**Windows.Devices.Lights.Effects**](/uwp/api/windows.devices.lights.effects) APIs.
:::column-end:::
:::column:::
[AutoRGB Sample](https://github.com/microsoft/Dynamic-Lighting-AutoRGB)
Demonstrates how to extract a single, representative color from a desktop screen and use it to illuminate LED lamps on a connected RGB device.
:::column-end:::
:::row-end:::