Color Templating

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.

Usage

Here’s an example of how to integrate a Color field into your template.

  • ejs
  • pug
  • pug (API v1)
Copy
<h2 style="color:<%= document.data.color %>">Colorful Title</h2>
Copy
h2(style="color:" + document.data.color) Colorful Title
Copy
h2(style="color:" + document.getColor('blog-post.color')) Colorful Title