Skip to main content
Participant
January 20, 2017
Answered

Make a color hidden.

  • January 20, 2017
  • 2 replies
  • 1125 views

Hello!

Does anyone know if it's possible to make a color with scripting that doesn't show up in the swatches panel of indesign?

greetings,

Stefan

This topic has been closed for replies.
Correct answer Laubender

Hi Stefan,

see this post and the following:

Re: Coloring a Font with a RGB etc. without adding the color to the document swatches.

Regards,
Uwe

2 replies

studio172Author
Participant
January 20, 2017

Yes true, there are hidden colors in the indesign model (indeed more colors in the color-collection than in the swatch-panel)...

The thing is: I was adding a gradient to indesign. To make the colorstops i have to make colors first and then assign them to the colorstops. And now the colorstops show up in the swatches panel (which i don't want... i only want the gradient to show up).

But if i remove the colors after having completed the gradient, the gradient goes wrong (all colorstops go to black...)

LaubenderCommunity ExpertCorrect answer
Community Expert
January 20, 2017
studio172Author
Participant
January 20, 2017

Great Uwe!!!

Thanks a lot! I've been banging my head on this problem for days!

This does the trick:

var myUnnamedColor = app.activeDocument.colors[-1].duplicate();

(kind of strange though... an index of -1?)

Loic.Aigon
Legend
January 20, 2017

I ma not sure about that lthough I was told (and checked) that there was (is it still there ?) a bug that when you did something in the swatch panel (maybe add a swatch or something like that), then extra colors were added without showing up. I mean you could have 10 swatches visually in the panel but 12 colors in the collection of colors.

But anyway, I doubt you could reproduce this per scripting (unless I am wrong) but if you intend to use a color only for a temporary purpose, the, you could create it, use it, save/export or whatever operation, then remove the color.

FWIW

Loic