Color Field Reference
The Color field allows content writers to select a color through a variety of color pickers and have the option to input a hex color value manually.
The Color field allows users to select a color via a color picker. It returns the color's hex code.
When configuring a Color field you'll see the options to set the Field name and API ID.
Slice Machine vs. Legacy Editor
Editing fields is almost identical in Slice Machine and the Legacy editor. But it is important to know that the mock config option (to add data to preview content fields in the Slice Simulator) is only available in Slice Machine.
Edit the JSON model with caution
Only edit the JSON model to make changes to the Rich Text field labels. Making abrupt changes can cause conflicts when synchronizing changes with your documents.
type
string (required)
Value must be Color
config
object
Object for the configuration options
config.label
string
The label that shows up for the field in the entry editor
"example_color": {
"type": "Color",
"config": {
"label": "Color"
}
}
Here is an API response example of a Color field with the API ID of example_color:
// API response example of a Color field
{
//...
"example_color": "#5b295f"
}
Was this article helpful?
Can't find what you're looking for? Spot an error in the documentation? Get in touch with us on our Community Forum or using the feedback form above.