Applying Any CMYK Color During a Data Merge
In my last article, I demonstrated a technique that could be used to apply colors to fills, type, variable QR Codes and vector graphics during a Data Merge. A limitation with this technique is that it relies on having the appropriate swatches already in the Swatches panel. This means any new color added to the database requires a not only a new swatch to be created, but also a new character style and a new GREP style applied to the paragraph style.
With the technique in this article, it’s possible to apply any whole-number color formulas with the process colors Cyan, Magenta, Yellow, and Black (CMYK).
What’s required for this technique
- Character styles for each color shade in 1% increments*
- A paragraph style for each color channel that contains the GREP instructions identical to the heat map GREP styles demonstrated here*
- A text frame that is set to Darken at the Object level in the Effects panel. Four of these frames will be required for each color channel that will combine to make the final color*
- A frame that will become a frame that changes color*
- A database that has four columns that will contain values between 0-100 for each of the color channels Cyan, Magenta, Yellow and Black
*Because this is a tedious chore, I’ve done this in advance and you can download the files by clicking here. The text frames containing the color channels have been pre-filled with the number 50.
How this technique works
It works in an identical fashion to the GREP heat map technique: when presented with a number between 0-100, a GREP style determines what tint strength of the underlying fill color is required. The point of difference with this technique is that it happens to four different colors that are then overlapped with the Darken blend mode in the Effects panel. The result is a full color square that can then be applied in a fashion similar to the Knockout Group transparency technique.
Preparing this technique
First, open the linked file to obtain parts 1-4 of what is needed for the technique.
Next, from the Data Merge panel, select the text database that will be used to represent the color values. In this example, the database has four fields, one for each color channel.
With the text tool, highlight the text that is currently in the light cyan square and then add the Data Merge field that contains the Cyan field into the text frame and turn the Data Merge preview on.
Repeat this process with the remaining three colors, toggling through records to confirm that the colors in the squares are changing accurately.
If the colors are behaving as expected, highlight the four color squares and align them to their horizontal and vertical centers, and group the selection. Notice that the colors are combining to form the end-value color.
Toggle through the records to confirm that the colors are behaving as expected, and the effect is behaving as expected, cut the newly grouped item and in the clear rectangle, select paste into.
The technique is now complete and can be implemented in a similar fashion to the techniques demonstrated in the changing colors article. To demonstrate this, I’ll open the example from the changing colors article, and implement the technique here.
Because the color channel values weren’t in the original database used to prepare the original technique, this meant adding the four columns to that database so that the colors would change.
Taking it even further: spot colors and gradients
The technique will also work if the CMYK swatches are replaced with spot colors, mixed inks, or gradients. The only tweaking to this technique will be changing the variable color frames at the start from the Darken blend mode to Multiply.