> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::SetLightingColor

> 입력 장치에 있는 하나 이상의 램프에 대한 색을 스테이징합니다.

입력 장치에 있는 하나 이상의 램프에 대한 색을 스테이징합니다. 색은 다음에 [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)를 호출할 때 장치에 전송됩니다.

## 구문

```cpp theme={null}
void SetLightingColor(
    GameInputColor color,
    GameInputLightingGroups group,
    uint32_t groupOrderIndex = GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL
);
```

### 매개변수

*color*\
형식: [GameInputColor](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputcolor)

선택한 램프에 대해 스테이징할 색입니다.

*group*\
형식: [GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)

설정할 램프를 포함하는 조명 그룹 선택 항목입니다. 하나 이상의 명명된 그룹 플래그, 장치의 모든 램프를 선택하는 `GameInputLightingGroupAll` 또는 명명된 그룹에 속하지 않는 램프를 선택하는 `GameInputLightingGroupUnknown`일 수 있습니다.

*groupOrderIndex*   \_In\_opt\_\
형식: uint32\_t

*group* 내의 개별 램프를 선택합니다. 기본값인 `GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL`은 *group*의 모든 램프를 선택합니다. 다른 값이 해석되는 방식은 설명을 참조하세요.

### 반환값

형식: void

## 설명

`SetLightingColor`는 램프를 즉시 변경하지 않습니다. 선택한 램프의 색을 기록(스테이징)합니다. 스테이징된 모든 색을 단일 업데이트로 장치에 전송하려면 [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)를 호출하세요. 색을 적용할 때까지 아무것도 전송되지 않으므로, 여러 그룹 또는 개별 램프를 설정하여 동시에 변경되도록 할 수 있습니다. 스테이징된 색은 적용된 후에도 계속 유효하므로, 나중에 한 그룹을 변경하려면 해당 그룹의 새 색만 스테이징하고 다시 적용하면 됩니다.

*groupOrderIndex* 매개변수는 다음과 같이 해석됩니다.

| *groupOrderIndex*의 값 | 선택되는 램프 |
| - | - |
| `GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL` (0xFFFFFFFF) | *group*의 모든 램프입니다. |
| *group*이 `GameInputLightingGroupKeyboardKey`인 경우 키보드 스캔 코드 | 해당 스캔 코드를 가진 키의 램프입니다. 스캔 코드는 Set 1 인코딩을 사용합니다. 0x01~~0x7F, 확장 스캔 코드 0xE001~~0xE07F 또는 Pause 키의 경우 0xE11D입니다. |
| 기타 모든 값 | *group* 내에서 해당하는 0부터 시작하는 위치에 있는 램프입니다. 값은 *group*에 대해 [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)가 반환하는 값보다 작아야 합니다. |

`GameInputLightingGroupKeyboardKey`를 다른 명명된 그룹과 결합한 선택 항목은 인덱스가 모호해지므로 개별 램프를 선택할 수 없습니다. 이러한 선택 항목에는 `GAMEINPUT_LIGHTING_GROUP_ORDER_INDEX_ALL`을 사용하세요. `GameInputLightingGroupAll`은 장치의 모든 램프 중 0부터 시작하는 위치로 개별 램프를 선택할 수 있습니다.

선택 항목이 장치에 유효하지 않으면 호출이 무시되고 아무것도 스테이징되지 않습니다. 선택 항목에 장치에 없는 명명된 그룹이 포함되어 있거나([IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md) 참조), 램프가 포함되어 있지 않거나, 범위를 벗어나거나 유효한 스캔 코드가 아닌 *groupOrderIndex*를 지정하면 유효하지 않습니다. 연결이 끊어진 장치에 대한 호출은 아무런 효과가 없습니다.

스테이징된 색을 삭제하고 램프를 기본 동작으로 되돌리려면 [IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)를 호출하세요.

다음 예제는 컨트롤러의 페이스 버튼을 빨간색으로, 중앙 조명을 파란색으로 설정한 다음 두 색을 단일 업데이트로 적용합니다.

```cpp theme={null}
void SetControllerLighting(IGameInputDevice* device) noexcept
{
    const GameInputLightingGroups groups = device->GetSupportedLightingGroups();

    if ((groups & GameInputLightingGroupFaceButtons) != 0)
    {
        device->SetLightingColor({ 255, 0, 0 }, GameInputLightingGroupFaceButtons);
    }

    if ((groups & GameInputLightingGroupCenterLight) != 0)
    {
        device->SetLightingColor({ 0, 0, 255 }, GameInputLightingGroupCenterLight);
    }

    device->ApplyLightingColors();
}
```

다음 예제는 키별 조명이 있는 키보드에서 모든 키를 어둡게 하고 Set 1 스캔 코드가 0x1E인 A 키를 강조 표시합니다.

```cpp theme={null}
void HighlightKeyA(IGameInputDevice* device) noexcept
{
    if ((device->GetSupportedLightingGroups() & GameInputLightingGroupKeyboardKey) == 0)
    {
        return;
    }

    device->SetLightingColor({ 16, 16, 16 }, GameInputLightingGroupKeyboardKey);
    device->SetLightingColor({ 0, 255, 0 }, GameInputLightingGroupKeyboardKey, 0x1E);
    device->ApplyLightingColors();
}
```

> [!NOTE]
>
> 조명 지원은 장치와 플랫폼에 따라 다릅니다. 현재 GameInput은 Windows 동적 조명(LampArray) 장치와 DualSense 컨트롤러의 라이트바에서 조명을 지원합니다.

## 요구 사항

**헤더:** GameInput.h

**라이브러리:** gameinput.lib

**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[GameInput 개요](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)\
[GameInputColor](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/structs/gameinputcolor)\
[GameInputLightingGroups](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/input/gameinput/enums/gameinputlightinggroups)\
[IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)\
[IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)\
[IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)\
[IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)

## 버전 기록

| 버전 | 변경 사항 |
| - | - |
| **v4** | 도입됨. |


## Related topics

- [IGameInputDevice::ApplyLightingColors](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingcolors.md)
- [IGameInputDevice::ApplyLightingSystemDefault](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_applylightingsystemdefault.md)
- [IGameInputDevice::GetSupportedLightingGroups](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroups.md)
- [IGameInputDevice::GetSupportedLightingGroupSize](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getsupportedlightinggroupsize.md)
- [GameInput API 멤버](https://docs.xbox.com/ko/reference/input/gameinput/gameinput_members.md)
