# readColor(id,color)

### 参数

| 参数名   | 类型            | 描述                                                                     |
| ----- | ------------- | ---------------------------------------------------------------------- |
| id    | unsigned char | 要控制的ID号，范围0\~10                                                        |
| color | String        | 填入要检测的颜色，目前支持Red,Green,Blue,Yellow,Cyan,Purple,Orange,Black,White,Gray |

### 返回

| 参数名    | 类型      | 描述                           |
| ------ | ------- | ---------------------------- |
| number | boolean | 返回布尔值，若设置的颜色和检测的颜色相同则返回真，否则假 |

### 例子


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ubtechedu.gitbook.io/chinese/standard/sensor/color/readcolor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
