An add-on for Advanced Custom Fields to allow users to select from a list of color choices.
“高级自定义字段”的附件,允许用户从颜色选择列表中进行选择。
Setting up the field works exactly like setting up a radio button list, the main difference being that the key will also be used to style the element.
设置字段的工作原理与设置单选按钮列表的工作原理完全相同,主要区别在于该键也将用于设置元素的样式。 p>
This is useful for allowing users to pick from a limited selection of colors, rather than enter an arbitrary hex value or choose from a color picker.
对于允许用户从有限的颜色选择中进行选择,而不是输入任意十六进制值或从颜色选择器中进行选择,这很有用。 p>
Supports all of the following color formats:
支持以下所有颜色格式: p>
- hex: #FF0000
- 十六进制:#FF0000 li>
- rgb: rgb(255,0,0)
- rgb:rgb(255,0,0) li>
- rgba: rgba(255,0,0, 1)
- rgba:rgba(255,0,0,1) li>
- hsl: hsl(0,100%,50%)
- hsl:hsl(0,100%,50%) li>
- hsla: hsla(0,100%,50%, 1)
- hsla:hsla(0,100%,50%,1) li>
- name: red
- 名称:红色 li>
ul>
Note: you may also use none
to show a transparent swatch with a checkerboard background.
注意:您也可以使用 none code>来显示具有棋盘背景的透明色板。 p>Compatibility
兼容性 h3>
This ACF field type is compatible with:
此ACF字段类型兼容: p>
- ACF 4
- ACF 4 li>
- ACF 5 (PRO version)
- ACF 5(专业版) li>
ul>