Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 2.01 KB

lamparray_setcolorsforkeys_696151623.md

File metadata and controls

51 lines (33 loc) · 2.01 KB
-api-id -api-type ms.custom
M:Windows.Devices.Lights.LampArray.SetColorsForKeys(Windows.UI.Color[],Windows.System.VirtualKey[])
winrt method
RS5

Windows.Devices.Lights.LampArray.SetColorsForKeys

-description

Sets the color of multiple lamps, corresponding to mapped keys. Position within each array maps keys to desired color.

-parameters

-param desiredColors

Array of desired colors.

-param keys

Array of corresponding VirtualKeys to modify.

-remarks

If the lamp index doesn't support the desired color, it is set to the NearestSupportedColor

If a VirtualKey is not bound to any lamp on the device, it is ignored and the remaining are still applied.

Black is equivalent to a lamp being 'off'.

-examples

:::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:::

-see-also

Lighting and Illumination (www.usb.org), Dynamic lighting