> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.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](/reference/tools/pix3/functions/pix_color) 为事件指定特定颜色。或者，使用 `PIX_COLOR_INDEX` 指定一组唯一的事件类别，让 PIX 选择用于表示每个类别的颜色。`PIX_COLOR_INDEX` 允许使用八个不同的颜色索引。该函数将使用 *i* % 8 对索引值进行取模处理，以选择用于确定合适颜色的索引。\
PIX\_COLOR\* 函数可用于为多个函数确定颜色参数，以表示它们在 PIX 图表中的显示方式。这些函数包括重载方法 [PIXBeginEvent](/reference/tools/pix3/functions/pixbeginevent-overloads) 和 [PIXSetMarker](/reference/tools/pix3/functions/pixsetmarker-overloads)。

## 要求

**头文件：** pix3.h

**库：** pixevt.lib

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

## 另请参阅

[PIX\_COLOR](/reference/tools/pix3/functions/pix_color)\
[PIXBeginEvent](/reference/tools/pix3/functions/pixbeginevent)\
[PIXSetMarker](/reference/tools/pix3/functions/pixsetmarker)\
[PIX3](/reference/tools/pix3/pix3_members)\
[PIX（NDA 主题）](/tools/tools-console/pix/pix)


## Related topics

- [PIX_COLOR](/zh-CN/reference/tools/pix3/functions/pix_color.md)
- [PIXSetMarker function](/zh-CN/reference/tools/pix3/functions/pixsetmarker.md)
- [PIXBeginEvent 函数](/zh-CN/reference/tools/pix3/functions/pixbeginevent.md)
- [PIXBeginEvent 函数参考](/zh-CN/reference/tools/pix3/functions/pixbeginevent_2.md)
- [PIXSetMarker reference](/zh-CN/reference/tools/pix3/functions/pixsetmarker_2.md)
