Create Hexadecimal Color Swatches in InDesign for Interactive Documents

InDesign doesn't allow speccing a color with hex or html color codes... until now!

There are lots of ways to spec a new color swatch in InDesign, but they’re all based on RGB, CMYK, Lab, or a color library such as Pantone or Trumatch. Many folks brought up with HTML find it helpful to spec colors in hex code (such as #41bbac) or using standard HTML color names (such as red, purple, or darksalmon). If you’re into those kinds of colors, you’re going to love this new, free add-on from in-tools.com called ?CreateHexSwatch.

CreateHexSwatch is technically a “start-up script,” which means it shows up as an actual menu command, not in the Scripts panel. It works with InDesign CS3, CS4, or CS5. It comes with an mxp installer which works in CS5, or — if you’re using CS4 or CS3 — you can simply drag the “?CreateHexSwatch” folder into your Scripts folder (inside your InDesign application folder).  When you relaunch InDesign, the item New Hex Swatch shows up in your Swatches panel menu:

hex1.png

When you choose that, up pops a dialog box that lets you spec your color in a number of ways:

hex2.png

You can drag the sliders, type (or paste) a hexadecimal value, or type in a html color name. If you have Photoshop running, the dialog box even lets you grag the current foreground color… is that totally awesome, or what?!

Hidden bonus tip: If you click on the color swatch (the colored square), you can use your system color picker to choose the color. (At least that works on the Mac OS… someone try it on Windows for me, please.)

As with the regular new color swatch dialog box, you can click Add to add the button and leave the dialog box open, or click OK to add-and-close. Curiously, this dialog box floats kind of like a panel/palette, so you can actually leave it open on your screen. That’s wacky.

Of course, if you are creating documents for print, this add-on may not be so helpful. Even though there is an option to define these colors as CMYK, you should always refer to a printed swatch book for best results (not just picking a color that looks good on screen).

To download CreateHexSwatch, click here.

Quick history of this plug-in: Someone asked me if such a thing was possible last week, I bounced the idea of a script off Harbs, and this week we have a new feature that is going to help a lot of people! I applaud Harbs and in-tools.com (a source for great plug-ins and scripts, both commercial and custom-made).

Enjoy!

Bookmark
Please login to bookmark Close

This article was last modified on December 20, 2021

Comments (51)

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Hi
    Is this working with indesign CS5….? desperate here.
    Thanks
    Dan

  2. David Blatner

    Note that InDesign CC now lets you add RGB colors using hex: https://creativepro.com/the-swatch-panels-stealth-feature.php

  3. Oh my goodness this is fantastic! I’ve been struggling with trying to get the right RGB/CMYK but this makes life so much easier. Thanks for sharing!

  4. Mike Matvy

    I’m trying to get my color palette imported into my Photoshop CS5 program using hexadecimal code such as 55C1FFFF. I have read the thread above and have downloaded CreateHexSwatch to my Mac.

    I have followed the directions to;”Double click on the file named CreateHexSwatch.mxp. This will open the Extension Manager and you will be prompted to install the extension.”. When I do this I get a message that says: “This extension cannot be installed, it requires InDesign version six or greater.”.

    Is InDesign a part of my Photoshop CS5 program that I install from a disk? Is there a way I’m going to be able to use hexadecimal color codes with my Photoshop CS5 program?

    1. David Blatner

      Mike: this add-on is for InDesign, not Photoshop. It lets you add hex swatches to InDesign. However, as I think the page says, the mxp extension manager installer doesn’t work with some versions of the product, so you have to read the instructions on how to install it manually.

  5. I just tried this in CS6 and it did not work. What could I be doing wrong? Has anyone who was have problems with the in CS6 gotten this resolved?

    1. I had to try downloading twice before I got it to work on CS6 Mary.

    2. David Blatner

      Mary: The extension manager thing probably isn’t working right. You need to install it manually. Read the ReadMe file carefully to see how to do it.

  6. I just tried this in CS6 and it did not work. What could I be doing wrong?

  7. Website Designer

    Nice tip with examples… what more can people want?! You see these interactive documents more and more. People should be able to use this to their advantage in their business.

  8. Hylda Von Dincklage

    Hi All – Anyone managed to install this on Indesign CC???

    Thanks

  9. Thank you so much for this. I’m using it on an older version of Indesign CC (before the Adobe update) and it’s a life saver. I have to sync a website with a project in Indesign and it’s been a nightmare trying to match the colors. Thank you so much for this. :)

  10. Aaron Gray

    Wow, what a great script, David! Thanks so much!

  11. A working version for CC would be awesome. That’s what I use.

  12. I love this extension and use it all the time for InDesign CS6, but I can’t get it into InDesign CC. Any suggestions or updates to make it work?

    1. David Greenwell

      Ditto to Hailey, James and Aaron… would love to be able to install this in InDesign CC – but how?

  13. Does this work on Win8/Indesign CC? Doesn’t seem to be working for me….

    1. it works for me, win8.1, InDesign CC 2014

    2. Doesn’t seem to be working for me either in InDesign CC

  14. This is a great tip, thanks for posting. You know the old saying, you learn something new everyday.

  15. I think you just saved my life.

  16. Genius!! Thank you sooooo much.

  17. YOU JUST SAVED MY LIFE!

    Most appreciated :)

  18. Gabrielle Donnelly

    Great tool – thanks so much!

  19. This is an excellent tool, and one that saves a lot of time and hassle. I’m using it with ID CS3 on a mac and it works perfectly. Thank you so much for creating this :)

  20. Erm, can’t seem to get this to work. Installs fine and comes up in the swatches menu fine but then I type in the Hex no. and it all goes wrong. As soon as I click on the ‘name’ field the colour switches automatically to RGB black. Same thing if I simply click ‘Add’ or ‘Done’. What am I doing wrong?

  21. Stuart Wainstock

    New to InDesign and this has been extremely useful! Thanks for the post.

  22. works also on Indesign 6.0. Thank you so much!!!!! I love it.

  23. Thanks for the script!

  24. Daria Perreault

    This is a must-have! Thank you so much for posting!

  25. wow!!! this is so amazing and easy…thank you!!!!

  26. Najib Dajani

    Thanks a lot. I never spec colors in Hex but what I use Hex values a lot for is copying and pasting colors.

    If I am creating styles (Drop Shadow, Outer Glow, etc) in Photoshop or InDesign, the Hex value is the only way that I know of to copy and paste colors between panels.

    I use it in the same way in Illustrator to copy and paste colors.

    Thanks again.

  27. A million thanks! I have spent several hours struggling with Photoshop to recolor a logo with specific hex colors (Photoshop CS5, it keeps “changing” the codes). I ran across this today, and in 5 minutes the task was done. I am a long-time follower, there is so much of value here! Thanks again!

  28. Colin Weston

    I guess I am the only one trying this who uses a Windows computer. Yes, David, double-clicking the color swatch in the dialog box does invoke the Windows system color picker. I am new to Web design and inter-active docs so the hex numbers still look like so much gibberish to me. Always another code to learn! Thanks a lot good people.

  29. Yay, thanks one more reason to design websites with ID ^__

  30. David Blatner

    @Steven: Oh, that is a huge question. I suggest you click on Forums above and post this in the forums for a wider audience to see.

  31. Steven Shaps

    Lost in confusion, I would like to publish a book on line epub through my website
    it is combo, poetry, full spread photos, interactive pages and sound and transitions

    what is the way to to go
    swift html

    pdf interactive and add sound in adobe acrobat

    I have adobe master suite

    please assist
    thank you

  32. David Blatner

    Harbs, I think you are correct. Interesting!
    That’s a great blog post, too. Very helpful to anyone interested in scripting.
    Thanks again for a great script and service to the InDesign community.

  33. @ David: I stand by AD00BE. It’s quite close to the InDesign color… 8)

  34. For all those interested in some of the technical details in creating this, check out my blog post here: https://in-tools.com/wordpress/indesign/scripts/hexadecimal-swatches-in-indesign

  35. @Theun: LOL!

    I think it’s going to have to be: AD00BE… ;) (173,0,190)

  36. David Blatner

    @Jongware: LOL. Unfortunately, you need three hex digits… but AD0BEE is a very lovely purple (brighter than ID purple, though).

  37. So … what color is “AD0BE”?

  38. Alan Gilbertson

    David, this is great! Such a simple thing to bypass an irritation in the UI.

    It’s particularly relevant because I find myself doing more and more work in InDesign that I used to do in Photoshop. Digital (LED) advertising billboards, marquees, web banners and even web page headers are so much faster and easier to lay out in ID than in Photoshop.

    The supermassive, singularity-creating SWFs that ID produces aren’t a lot of use for web, but they are functional for interactive touch-displays and animated digital signage (which I don’t much care for, but the client does!). They’re all RGB and again, being able to specify hex values is handy.

  39. Alan Gilbertson

    @Eugene: Me too. This script makes it way easier to transfer colors when pulling values from Photoshop or Dreamweaver.

  40. Eugene Tyson

    Nice. Good to know. A few people have asked me about this.

    I’ve been using the Kuler panel to insert Hex values add the swatches.

  41. David Blatner

    @Franck: It works the proper way (eab converts to a very pretty EEAABB).

    @Marijan: Thanks for the info!

    Also, note that the color lookup works both ways. If you type 8b0000, it names it DeepRed (because that’s the html name).

  42. Great !

    While this is still fresh, how does it receive #FFF ? as #FFFFFF or as an error ? (i’m too lazy to try)

  43. Marijan Tompa (tomaxxi)

    Hidden bonus tip works on Win XP!
    Great work!
    Thanks!

  44. Jennifer Pade

    Great! I was JUST trying to do this today!
    thanks,
    Jennifer