Skip to main content
All color update functions on ILampArray use the LampArrayColor struct to represent an RGBA color value. The alpha value (LampArrayColor::a) represents the relative transparency of a color, where zero is fully transparent and 0xFF is fully opaque. If an alpha value other than 0xFF is used, the color will undergo an additional blending step against black. To avoid this blending step, don’t pass an alpha value other than 0xFF when setting colors. ILampArray SetColor APIs are designed to be called from a single thread for best performance and Lamp state consistency.

Updating all Lamps

The ILampArray::SetColor method changes all Lamps on the device to match the desired color. The following example registers a LampArray callback and sets the color of each attached device.

Targeting individual Lamps or Lamp Groups

ILampArray::SetColorsForIndices is used to update one or more Lamps of a LampArray. The Lamp indices passed into this API can be in any order. The following example illustrates how to set alternating colors on all Lamps of a LampArray.
The following example shows how to update colors for individual Lamps or groups of Lamps on a LampArray.

Targeting Lamps using keyboard scan codes

ILampArray::SetColorsForScanCodes provides an easy way to set Lamp colors of specific keys on a LampArray keyboard. This can be useful for helping to teach users which keys to press in a tutorial setting, for example, or in showing game state related information on the keyboard. The following example illustrates how to change the Lamp color of the WASD keys on a LampArray keyboard:

See also

Lighting API Overview ILampArray Reference LampArrayColor ILampArray::SetColor ILampArray::SetColorsForIndices ILampArray::SetColorsForScanCodes
Last modified on August 4, 2026