Share via


LampArray.SetColorForIndex(Int32, Color) Method

Definition

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

LampArray sample

Demonstrates how to control RGB lighting of peripheral devices using the Windows.Devices.Lights and Windows.Devices.Lights.Effects APIs.

AutoRGB Sample

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, the call fails silently.

Black is equivalent to a lamp being 'off'.

Applies to

See also