Trying to create an action to create a swatch from HEX code in clipboard

New Here ,
Dec 04, 2020

Copy link to clipboard

Copied

I need to build an action for my team to be able to create a swatch on a new layer using a HEX code we copied from text outside of photoshop.

Some background info, we retouch clothing for an international line, edit about a few hundred images a day. One of our responsibilites is making sure the color in the photo is accurate to the product, but now we're working from home and rely on HEX codes provided by the photographer to color correct to.

It sounded simple enough to do at first, but once I got into it, I realized the action process when changing a primary color seems to have no way to record "paste" and just records setting the color to whatever test HEX code I'm using. Is there a way around this? Or another way to create a swatch from whatever HEX code we currently have copied?

TOPICS
Actions and scripting, Feature request, How to

Views

120

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Trying to create an action to create a swatch from HEX code in clipboard

New Here ,
Dec 04, 2020

Copy link to clipboard

Copied

I need to build an action for my team to be able to create a swatch on a new layer using a HEX code we copied from text outside of photoshop.

Some background info, we retouch clothing for an international line, edit about a few hundred images a day. One of our responsibilites is making sure the color in the photo is accurate to the product, but now we're working from home and rely on HEX codes provided by the photographer to color correct to.

It sounded simple enough to do at first, but once I got into it, I realized the action process when changing a primary color seems to have no way to record "paste" and just records setting the color to whatever test HEX code I'm using. Is there a way around this? Or another way to create a swatch from whatever HEX code we currently have copied?

TOPICS
Actions and scripting, Feature request, How to

Views

121

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 04, 2020 0
Most Valuable Participant ,
Dec 04, 2020

Copy link to clipboard

Copied

It does not sound simple.  There is no way you could record an action to do that.  You should be able to  program a Photoshop Script to add a new layer and fill a square section of it with a hex color.  There is no interface to drop a hex code on Photoshop.  You can drop files onto Photoshop. So if you drop a Photoshop script file on Photoshop Photoshop will run it.  The script could have the Hex code coded in it or get it some way,  like with a user prompt. Where the user could type or Paste in the hex code.  The script could be run from a shortcut or an action.

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2020 1
Adobe Community Professional ,
Dec 04, 2020

Copy link to clipboard

Copied

What OS are you using? You can get the clipboard contents via AppleScript. This would set the foreground color to a valid hex value on the clipboard:

 

tell application id "com.adobe.photoshop"
	set cb to the clipboard as string
	try
		set foreground color to {class:RGB hex color, hex value:cb}
	end try
end tell

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2020 1
Adobe Community Professional ,
Dec 04, 2020

Copy link to clipboard

Copied

I can't help you with your action but one word of warning for your process. Make sure the photographer specifying the Hex code and your retouchers using that code, are using the Hex code in the same colour space. Hex codes are simply base sixteen representations of the base ten RGB values and as such, the same Hex code represents different colours in different colour spaces (e.g. sRGB, Adobe RGB, Pro Photo etc). Or conversely the same colour requires different Hex codes in different colour spaces.

 

Dave

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 04, 2020 5
Adobe Community Professional ,
Dec 05, 2020

Copy link to clipboard

Copied

With extendscript you can copy text to clipboard, but not from. So tell us where the HEX code is copied from and if for example that's text file, the script can read easily its content to apply it as the whole or specified part.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 05, 2020 2
Adobe Community Professional ,
Dec 05, 2020

Copy link to clipboard

Copied

What if you put a step in your action to open the Color Picker where you could paste in the Hex code?

 

Like Edit>Fill>Color

One caveat is users would have to remember to click Color in order for the Color Picker to open.

Also remember to paste the Hex code as well.

Toggle the Fill Dialog step to On in the actions panel.

 

 

ef.png

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 05, 2020 1