> ## 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.

# PIX_COLOR_INDEX

> PIX_COLOR_INDEX

# PIX\_COLOR\_INDEX

指定一组唯一的事件类别，让 PIX 选择用于表示每个类别的颜色。

## 语法

```cpp theme={null}
UINT PIX_COLOR_INDEX(  
         BYTE i  
)  
```

### 参数

*i*   \
类型：BYTE

颜色的索引。

### 返回值

类型：UINT

返回一个包含代表该类别颜色的 UINT。

## 备注

使用 PIX\_COLOR\* 函数指定颜色，以作为元数据传递给 PIX 事件/标记 API。使用 [PIX\_COLOR](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pix_color.md) 为事件指定特定颜色。或者，使用 `PIX_COLOR_INDEX` 指定一组唯一的事件类别，让 PIX 选择用于表示每个类别的颜色。`PIX_COLOR_INDEX` 允许使用八个不同的颜色索引。该函数将使用 *i* % 8 对索引值进行取模处理，以选择用于确定合适颜色的索引。\
PIX\_COLOR\* 函数可用于为多个函数确定颜色参数，以表示它们在 PIX 图表中的显示方式。这些函数包括重载方法 [PIXBeginEvent](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixbeginevent-overloads.md) 和 [PIXSetMarker](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixsetmarker-overloads.md)。

## 要求

**头文件：** pix3.h

**库：** pixevt.lib

**支持的平台：** XBOX One 系列主机和 XBOX Series 主机

## 另请参阅

[PIX\_COLOR](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pix_color.md)\
[PIXBeginEvent](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixbeginevent.md)\
[PIXSetMarker](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixsetmarker.md)\
[PIX3](https://docs.xbox.com/zh-CN/reference/tools/pix3/pix3_members.md)\
[PIX（NDA 主题）](https://docs.xbox.com/zh-CN/tools/tools-console/pix/pix.md)


## Related topics

- [PIX_COLOR](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pix_color.md)
- [PIXSetMarker(UINT64, PCSTR, ...)](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixsetmarker.md)
- [PIXBeginEvent(UINT64, PCSTR, ...)](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixbeginevent.md)
- [PIXBeginEvent(UINT64, PCWSTR, ...)](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixbeginevent_2.md)
- [PIXSetMarker(UINT64, PCWSTR, ...)](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixsetmarker_2.md)
