> For the complete documentation index, see [llms.txt](https://yinglinhan.gitbook.io/framer-x-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yinglinhan.gitbook.io/framer-x-api/library-ku/color/compare.md).

# Compare

Colo&#x72;**.inspect**(color, initialValue): string

把一个颜色对象转换成可读的字符串形式，一般用来debug

```jsx
const blue = Color("#0099FF")

Color.inspect(blue)
```

| <p>color: Color</p><p>The Color object to format</p>                                                                      |
| ------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>initialValue:</strong> string</p><p>这是一个可选参数，A canonical hex string to be used instead of an rgba() value.</p> |
| **returns:** string                                                                                                       |

Color.**isColor(color)**: boolean

验证传进来的参数是不是合法的颜色值

```jsx
Color.isColor("#0099FF") // true
Color.isColor(Color("#0099FF")) // true
```

\| <p>color: string | Color</p><p>要进行验证的值</p> |
\| ------------------------------------------ |
\| **returns:** boolean                       |

Colo&#x72;**.isColorObject**(color):color is object & Color

验证传进来的参数是否为一个color对象，返回true或false

```jsx
const blue = Color("#0099FF")

Color.isColorObject(blue) // true
Color.isColorObject("#0099FF") // false
```

| <p>color: any</p><p>一个颜色对象或者其他</p> |
| ---------------------------------- |
| returns: color is object & Color   |

Color.**isColorString**(colorString): boolean

检查传进来的值是否为一个合法的颜色值的字符串，返回true或者false

```jsx
Color.isColorString("#0099FF") // true
```

\| <p>colorString: string | object</p><p>A string representing a color</p> |
\| ----------------------------------------------------------------------- |
\| returns: boolean                                                        |
