Templating the Color field
The Color field allows content writers to select a color through a variety of color pickers as well as having the option to manually input a hex value.
Before Reading
This article assumes that you have saved the document object in a variable named document as shown in the Retrieve the document object page.
Here's an example of how to retrieve a Color field value. In this case, the Color field has the API ID of color.
Copy
const color = document.color;