'red' 这样人类可读的颜色,请使用 human()。ff0000 这样的十六进制颜色(在 HTML/CSS 中使用),请使用 rgb()。还有其他颜色格式的方法,例如 hsl()、cmyk()、hwb()、lab() 和 lch()。| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 CMYK 颜色的格式。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| space | ColorFormat | \sRGB' | 'display-p3' | 'rec2020' | 'a98-rgb' | 'prophoto-rgb' | 要为其生成颜色的颜色空间。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| includeAlpha | 布尔值 | false | 向颜色添加 Alpha 值(RGBA)。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| casing | 大小写 | 'lower' | 生成的十六进制颜色的字母类型大小写。仅在使用 'hex' 格式时适用。 |
| format | ColorFormat | 'decimal' | 生成的 RGB 颜色的格式。 |
| includeAlpha | 布尔值 | 'false' | 向颜色添加 Alpha 值(RGBA)。 |
| prefix | 字符串 | '#' | 生成的十六进制颜色的前缀。仅在使用 'hex' 格式时适用。 |