Mobile app version of vmapp.org
Login or Join
Shelley591

: How do I create color swatch for Photoshop from a list of RGB values? I have a list of colors as RRR GGG BBB in a text file and I need to use only those colors to create my images. I'd

@Shelley591

Posted in: #AdobePhotoshop #Automation #Color #Swatches

I have a list of colors as RRR GGG BBB in a text file and I need to use only those colors to create my images. I'd like to be able to load those colors to Photoshop's color palette (swatch). Is there a way to automate swatch creation process from within Photoshop or some other way to create swatch file from a list of colors as a text file?

(P.S. there should be tags such as Palette and Swatch)

Upd: I have lots of colors in the list and my list is not the only one, users are supposed to have easy way to convert the list into Photoshop compatible swatch file so we can all start drawing right away.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley591

3 Comments

Sorted by latest first Latest Oldest Best

 

@Gail6891361

ASE is Adobe Swatch Exchange Format. Unfortunately, it is a binary format, but fortunately, people have made source code available for ASE encoding scripts. See for instance ( blog.soulwire.co.uk/code/actionscript-3/as3-ase-adobe-swatch-exchange-encoder ).

Adobe may support ACBL format (XML) or ACF format (text), but they appear to be legacy formats and do not show up in the "load swatches" file types options.

This doesn't always mean they aren't supported, but you will need to get your file dialog to ignore the file-type filter:

windows, type *.* in the file name box and hit enter

10% popularity Vote Up Vote Down


 

@Samaraweera207

I'd create a small web page and then take a screen grab. You'll end up with a bitmap image you can place on a layer. From there you can sample the colours and use them in your design.

If your list looks something like this:

0 0 0
0 0 255
0 255 0
255 0 0


Some clever find/replacing should get you what's needed to create a web page. Depending on the exact characters in the document, you should hopefully be able to get the document into this format. Finding spaces and replacing with ", " should give you this:

0, 0, 0
0, 0, 255
0, 255, 0
255, 0, 0


You could then find the return character, and replace with something like this:

);">&nbsp;</div> *return character*
<div style="width:100px;height:100px;float:left;background:rgb(


So you end up with:

0, 0, 0);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(0, 0, 255);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(0, 255, 0);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(255, 0, 0)


Which means you just need to add a little bit of HTML to the start and end of the document to have a webpage you can display and screen grab.

<!DOCTYPE html>
<html lang="en-us">
<body>
<div style="width:100px;height:100px;float:left;background:rgb(0, 0, 0);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(0, 0, 255);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(0, 255, 0);">&nbsp;</div>
<div style="width:100px;height:100px;float:left;background:rgb(255, 0, 0);">&nbsp;</div>
</body>
</html>


Make sure the browser you use displays the colours in a way that matches your raw colour values though. You can test this by checking a few of the colours — see if they match the values you initially entered.

You could even save the find and replace strings and process future files in the same way.

If you really need the result to be a Photoshop swatch file, you might need to enlist a friendly developer to create a small script to build the files you're after.



Another option is scripting Photoshop to automate adding the swatches directly, rather than building a swatch file. The PS-Scripts forum might be a good place to look for help.
www.ps-scripts.com/bb/viewtopic.php?t=842

10% popularity Vote Up Vote Down


 

@Si6392903

You may not have the Color panel open by default, so click Window -> Color (or F6)
the color panel will open and you should see 3 RGB sliders, or 4 CYMK sliders depending on your colour mode.

Next to the sliders (left) are 2 squares, click on one of them and you get the "Color Picker" window.

Now simply enter the RGB numbers, and click "Add to Swatches" (it will then ask you for a name, then click save.

Done :-)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme