Skip to main content
Participant
September 21, 2022
Question

HEX Codes in Photoshop VARIABLES

  • September 21, 2022
  • 3 replies
  • 485 views

I recently learned how to use Variable data, text and images, however I am stuck as to how I can include the HEX codes of my clients brand colors into the excel file to auomatically change the fill color of multiple elements.

It may involve scripting, but I am very new to the world of photoshop scripting. How can I go about learning how to overcome this challenge?

I am on a macbook using Photoshop 2022

This topic has been closed for replies.

3 replies

D Fosse
Community Expert
Community Expert
September 21, 2022

Just for general context:

 

It's a very common misunderstanding that a hex number defines a color. It sounds computerish and geeky, so people assume some kind of absolute accuracy - and that's why it's commonly used for "brand colors". But that's an illusion.

 

Hex is just base 16 notation for standard RGB numbers. There's nothing special about hex. #d5703f = 213/112/63, #5e80ae = 94/128/174, and so on. Same thing.

 

Numbers are undefined until associated with a color space. That's what a color space is; a definition of numbers into specific colors and vice versa.

 

For RGB, you can often (but not always) assume sRGB IEC61966-2.1. For CMYK, all bets are off and everything is to the wind. About the only assumption you can make is that the color you get isn't exactly the one you intended. There's a myriad of CMYK profiles, each corresponding to a certain print process that may or may not be relevant. There is no universal and generic "CMYK" that is equally valid everywhere.

 

Look at the hex number and resulting color here:

Stephen Marsh
Community Expert
Community Expert
September 21, 2022

This isn't a native feature of Photoshop variables.

 

Even for Illustrator variables, it is complex, as shown by @Silly-V 

 

https://www.linkedin.com/pulse/illustrator-variable-data-advanced-techniques-recoloring-vasily-hall/?trk=hb_ntf_MEGAPHONE_ARTICLE_POST

Abambo
Community Expert
Community Expert
September 21, 2022

You should also be able to use decimal codes, I suppose. Hex codes are just practical because you have RRGGBB. But those hex codes translate to an equivalent decimal code. https://www.checkyourmath.com/convert/color/hexadecimal_decimal.php

 

It's the same number in a different base. Instead of having base 16 (numbers between 0 and 15 - with 15 being represented as F) you will have numbers in our decimal system (base 10, numbers between 0 and 9).

ABAMBO | Hard- and Software Engineer | Photographer