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

> PIX_COLOR

# PIX\_COLOR

为事件指定特定颜色。

## 语法

```cpp theme={null}
UINT PIX_COLOR(  
         BYTE r,  
         BYTE g,  
         BYTE b  
)  
```

### 参数

*r*   \
类型：BYTE

颜色的红色分量。

*g*   \
类型：BYTE

颜色的绿色分量。

*b*   \
类型：BYTE

颜色的蓝色分量。

### 返回值

类型：UINT

返回一个包含指定颜色的 UINT。

## 备注

使用 PIX\_COLOR\* 函数指定颜色，以作为元数据传递给 PIX 事件/标记 API。
使用 `PIX_COLOR` 为事件指定特定颜色。或者，使用 [PIX\_COLOR\_INDEX](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pix_color_index.md) 指定一组唯一的事件类别，让 PIX 选择用于表示每个类别的颜色。

PIX\_COLOR\* 函数可用于为多个函数确定颜色参数，以表示它们在 PIX 图表中的显示方式。这些函数包括 [PIXBeginEvent](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixbeginevent.md)、[PIXScopedEvent](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixscopedevent.md) 和 [PIXSetMarker](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pixsetmarker.md)。

## 要求

**头文件：** pix3.h

**库：** pixevt.lib

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

## 另请参阅

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


## Related topics

- [PIX_COLOR_INDEX](https://docs.xbox.com/zh-CN/reference/tools/pix3/functions/pix_color_index.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)
