Copy link to clipboard
Copied
Hello Community!
I am looking for a way to generate textboxes on top of paths that contain fill color information:
- Hex (probably not possible?)
- CMYK values
- RGB values.
Ideally you would select paths on your artboard, run the script and text boxes would be generated as such:
This script comes close, but does it for swatches in the document. However, I need it for the fill color for paths already on the artboard:
http://fashionclassroom.com/blog/handy-illustrator-script-for-printing-out-color-chips
https://github.com/johnwun/js4ai/blob/master/renderSwatchLegend.jsx
Also here is some discussion that touches on the subject: https://webcache.googleusercontent.com/search?q=cache:fLUn9JnVfDkJ:https://forums.adobe.com/thread/6...
Any help would be greatly appreciated!
Best regards,
Martin
Did you know that you can create a new color group from the selected paths?
Simply select your paths and push the "new color group" button at the swatch panel...
Then you can use the rederSwatchLegend.jsx from wundes
Maybe you have to modify it first...
If you saved it and changeed it to .JSX it should work fine. Ive got a link to my version here, https://github.com/schroef/Illustrator-Scripts/blob/master/renderSwatchLegend_v145.jsx
again click raw and make sure you save it and try to replace the .txt to .jsx
Ah yeah, that is due to the separator. Perhaps I should add an extra Rule for that as an option. Let me see if I can add this. I'll post an update link later.
It's always better to save the file directly to jsx from the browser unless you know how to save the file in a proper format without issues.
I got it working now as i think you asked for. Ive added an extra option, to join HEX values, this can keep other values split
Here's a link to the RAW script on my gitHub. Remember when saving from browser, remove .txt at the end
Copy link to clipboard
Copied
Hex is EXACTLY the same thing as RGB; it's just a different way of writing the same thing.
For instance, hex FF means 255, hex 80 means 128. So hex FF80FF means RGB 255, 128, 255.
Copy link to clipboard
Copied
Did you know that you can create a new color group from the selected paths?
Simply select your paths and push the "new color group" button at the swatch panel...
Then you can use the rederSwatchLegend.jsx from wundes
Maybe you have to modify it first...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I see you have HEX in the legend now as well. Ive added some extra features to this script, like HEX. That version did not have it yet back then. Ive also made an interface so you can choose what to show. Idea is to make it even more customizable in the feature. Wundes has updated to 4.4 with two of my adds, but not the one with the dialog and save settings
Here's a preview
Copy link to clipboard
Copied
Hi @schroef !
Where can your script with the interface be downloaded from? Also, couldn't seem to edit the one from johnwun at https://github.com/johnwun/js4ai/blob/master/renderSwatchLegend.jsx to work properly.
For the johnwun script I'm not sure where to download the jsx file directly (I can usually manage to find the download on github but not this time) so I've copied the text, saved as text edit on mac, changed the file to jsx and can get it to run in illustrator but it doesn't work. Attached the text file I converted to jsx here as well. Tried fiddling with the x/y values but it gives me this error. Tried selecting the shape with the colour, have them in the swatch panels or nothing selected and other variations. Also tried the solution above for generating the colour palette as a group and selecting the group, no luck.
I'm clearly missing something about how to use this script even with the basic instructions on the github that say "// This script will generate a legend of rectangles for every swatch in the main swatches palette." and the ones in this thread. Attached screenshot of the error I get. Help!
Copy link to clipboard
Copied
You can directly save that Jax by clicking "vier raw". Then add .ksx
His script lacks one more update I added, he didn't want that. I have added code so it saves all settings.
I'll post a link later today when I'm at work.
Ps it should work when you select swatches in the swatch panel. That's one of the edits I've made.
Copy link to clipboard
Copied
Hmm. Saved the raw file from here https://raw.githubusercontent.com/johnwun/js4ai/master/renderSwatchLegend.jsx
as text, changed to .jsx, it loaded fine in illustrators file > scripts to use but same issue.
Tried running the script with colored rectangle selected, coloured rectangle + swatch selected, no rectangle selected and only swatch. Put swatch in it's own group and selected the swatch and/or the group. Still no luck! Tried deleting all swatches except reg black/no fill, having only one new swatch and no luck either.
Think I'm missing something very basic in how to run the script, hope you can set me straight!
"This script will generate a legend of rectangles for every swatch in the main swatches palette. You can configure spacing and value display by configuring the variables at the top of the script."
Awaiting your script and reply that will hopefully be the ultimate fix. Thanks again.
Copy link to clipboard
Copied
I need to check something in the script. It returns weird errors about being able to add a group. Even the original shows that now. Let me fix that and then return to you
Copy link to clipboard
Copied
Thank you! Awaiting your next reply.
Copy link to clipboard
Copied
If you saved it and changeed it to .JSX it should work fine. Ive got a link to my version here, https://github.com/schroef/Illustrator-Scripts/blob/master/renderSwatchLegend_v145.jsx
again click raw and make sure you save it and try to replace the .txt to .jsx
Copy link to clipboard
Copied
Amazing thank you, the interface you added are so essential! And it seems the fix for me was to stop converting .rtf to .jsx, had to turn my textedit on mac into a plain text from Format > Make Plain Text..... did not realize the syntax error that illustrator was yelling about was me saving as rich text.
One question, is there a way to make the HEX render not have spaces? It comes out as "HEX xx xy 23" instead of "HEX xxxy23" for instance. Guessing this is a quirk of the script and a tradeoff for having CMYK and other values render with spaces? Regardless, this script will save SO MUCH time.
Copy link to clipboard
Copied
Ah yeah, that is due to the separator. Perhaps I should add an extra Rule for that as an option. Let me see if I can add this. I'll post an update link later.
It's always better to save the file directly to jsx from the browser unless you know how to save the file in a proper format without issues.
Copy link to clipboard
Copied
I got it working now as i think you asked for. Ive added an extra option, to join HEX values, this can keep other values split
Here's a link to the RAW script on my gitHub. Remember when saving from browser, remove .txt at the end
Copy link to clipboard
Copied
I've been searching for something like this to easily copy and paste color values into brand guides, this is amazing and will help so much!
Two questions:
THanks again for creating this, it's such a game-changer!!
Copy link to clipboard
Copied
Iol need to tix the hex code part. I noticed it sometime missed a leading 0. I got it working now in another scriot and will uodate this one asap.
It does save a file but i Bel ve i set it up so it saves it next to the workout jg document. I could change it so it saves that next to the ecript.
You can always adjust it your self if your comfortable doing so
Copy link to clipboard
Copied
I was able to figure out how to modify default settings actually! No luck on that '00' issue though, that was a bit too advanced for me ha! Will look out for an update whenever you get the chance 🙂 thanks again!
Copy link to clipboard
Copied
Well done! So you figured out in the lower end of the script file has the location for the json file to bestored. Nice work!
I had the plan to edit it this week, but as lofe goes. Something came in between. Perhaps today i can have another go at it.
Here's the updated version; link to raw code v1.4.8
Now HEX code is fixed. PS the settings were already saved next to the script. Doesnt that work for you?
It remembers last used settings. Just tested it and still works as it should. Each time you run it, it saves a JSON file with all settings. This was working in a couple versions back. Perhaps something did run well in the version you had. It does run properly today when i tested it
Copy link to clipboard
Copied
Hi, your link isn't working and this seems like a great script. Is it available anymore?
Copy link to clipboard
Copied
https://github.com/schroef/Illustrator-Scripts > renderSwatchLegend.jsx
Copy link to clipboard
Copied
Would you have any problem of my doing a TikTok video on your Version of the RenderSwatchLegend? I did one a couple months ago when I only knew of 1.4.4 but this looks far more advance. Please need this in their life.
Copy link to clipboard
Copied
Do so if you like. Be sure to show them where to get it! Ps post the video here if you can. Link it in a comment if possible or add a link to the post. Like to see it
Copy link to clipboard
Copied
Thank you @schroef for all your hard work.
I just uploaded the video to my TikTok channel. Unfortunately I don't know what you TikTok user name is, or else I would have tagged you.
https://www.tiktok.com/@gibbous.does.branding/video/7325082573103762731
Copy link to clipboard
Copied
No worries! Nice videos by the way
Copy link to clipboard
Copied
Thank you. I'm happy it meets your approval 🙂