Variable colour which changes from page to page?

Learn / Forums / General InDesign Topics / Variable colour which changes from page to page?

Viewing 19 reply threads
  • Author
    Posts
    • #56905
      ShayR
      Member

      I’ve been working on a magazine in which each article has is colour-coded with its own identifying colour to differentiate it from other articles. For example, there might be three software review sections running consecutively, each having its own specific colour.

      In each case, the main body text will be black, but things like page headings, bullets and call-outs will be in the second colour. Oh, and it’s a full-colour publication, so no two-colour spot trickery. And I’d like to keep to one single InDesign document.

      The question is: How can I avoid defining a set of paragraph and object styles for each colour used? Can I somehow say, “Hey InDesign, this A Head needs to be in this page’s special colour” without defining a new master page and a whole bunch of styles for each colour?

      Does this make any sense?

    • #56978
      SheilaM
      Member

      Make character styles that apply only a swatch color, no other attributes. You can apply this to any paragraph, so you do not need to redefine any paragraph styles. However, a bullet is defined within the paragraph style, and I have not found an easy way to change the color of the bullet without changing the bullet definition in the style or replacing the swatch – which is not what you want if you are using several bullet colors in one document. Find/Change does not seem to recognize the bullet character separately when it is part of a styled paragraph. Perhaps someone who is more familiar with GREP can help you with changing just the bullet colors within that style.

      With the object styles, I don't know an easier way than to duplicate the style and change the swatch color. That would also allow you to use Find/Replace to change format to switch the object colors if you want to do it afterwards.

    • #56980

      I have written a Javascript to test, and it seems to work fine for basic elements — text and fill/stroke on object, applied through styles.

      It does not work for items on a master page (you have to override these) and for bulleted lists (you have to convert these to text). It also doesn't work on table and cell styles, but theoretically that should be possible as well — I left it out for now because it's a bit more work ;-)

      But it requires discipline in your document setup and style usage!

      • First, you create swatches named “Page 1”, “Page 2”, “Page 3/4”, “Page 5/6/20”, and so on. The “x/y” notation lists multiple pages where the same swatch may be used — sorry, no niceties such as “Page 5-20” or “Page xxiv and xxvi up to the end” are allowed.
      • You create one single swatch called “Color Placeholder”. Make it a bright “bad” color (I suggest Hot Pink) so it's clearly visible when applied.
      • You apply this color only and exclusively through paragraph styles, character styles, and object styles. You cannot apply it directly to text or objects; that is because the applied color will get changed by the script, but the style color (“Color Placeholder”) will still be 'underneath'.
      • If you run the script, it scans all paragraph, character, and object styles for a fill color “Color Placeholder”, and for object styles also a stroke color “Color Placeholder”. If it finds a style with that color in the definition, it finds all occurrences where that style was applied, checks on what page it occurs, and changes the color in place — leaving the style unchanged.

      It's important that it changes the color “in place”, by directly changing the applied color. That's so you can run the script again, after inserting or removing pages, and editing text, and that's why you have to apply the color through styles.

      It's also important that you actually define a swatch for every page — if the script cannot find a color for page x, all items on that page will remain in their original color (Hot Pink, or one that was assigned in a previous run).

      You can download the test script by right-clicking here; select “Save Target As” (or equivalent) and save it right into your User Script folder. Don't forget to create the swatches and set up your styles before running!

    • #57159
      ShayR
      Member

      Thanks for the great replies.

      I have a month or so until the next issue of the mag, so I’m going to go sit in a darkened room and digest what I’ve read, and give Jongware’s script a go.

      If I don’t make progress, I’ll do a ‘half-way house’ of using several Word import maps to do most of the work for me. (The incoming Word files are reasonably well structured and InDesign does a good job at importing.)

    • #99591

      This post has been closed for a while and ShayR never posted back and De Jong’s script link is missing (404 page) but I have a similar situation and would love to hear if this script is available and currently working for InDesign CC.

    • #99592

      Really not sure I would take this way!
      It seems to me really more simple to play it with a “book” structure, one file per color! …
      The difference between each file: the color with a same name but values different per file, as:
      “IDColor” for pages 1-4: C100
      “IDColor” for pages 5-8: M100
      “IDColor” for pages 9-10: C100Y100

      [* “IDColor” is the name of the created color of course!]

      Of coure, avoid to synchronize !!! =D

      (^/)

    • #99597

      Hi Obi-wan. Thanks for your suggestion but, even though I use ID since ID1, circa 1999, it may be because it is my first day in here, I could not even start to understand your suggestion.

      My intention, like Chung_Chiang’s in a 2008 unanswered post (https://forums.adobe.com/thread/289283) is to vary automatic page numbers based on the number itself so each page on the book progressively varies its hue.

      I could not understand if your suggestion addesses this goal and, if it does, would you mind exploring it a bit further?

      Many thanks

    • #99599
      David Blatner
      Keymaster

      I think Obi-wan is saying: make each article a different InDesign document, and then put them together into a Book panel (File > New > Book). Then make sure the paragraph styles and color swatches are named exactly the same… but you can make the color swatch definitions different!

      So if you apply “Heading” then it applies a color “headingColor” (or something like that). But the definition of the “headingColor” swatch is different in each document.

      Welcome to InDesignSecrets, Bruno! It’s good to have people in the community who have used InDesign so long! :-)

    • #99603

      Thanks David. Happy to be here and I hope to be able to contribute sometime soon.

      If you are right about Obi-wan this is what I was kind of guessing and it is (unless I did not get it yet) what the intent is here.

      The idea is that every single page has a slightly different color, so page one is 0/0/100/0 CMYK and page 2, 0/10/100/0, page 3 0/20/100/0… page 10 could be 10/100/100/ and some progression like this — those would not be the actual colors but the idea.

      This seems to be exactly what Chung_Chiang’s was looking back in 2008 but he was not as lucky as I was.

      The closest thing I found to a variable automatically altered by its page number is Jacques Letesson’s post “Modify width of rectangle based on page number in InDesign via Javascript” ( https://forums.adobe.com/thread/1248995 ) but I don’t understand javascript enough to evolve it from modifying size to reapplying different colors.

    • #99605
      David Blatner
      Keymaster

      Ah, I see the problem with the script link above… I fixed the link in Jongware’s post to this new one: https://creativepro.com/downloads/applySwatchPerPage.v1.0.jsx

    • #99607

      Just a question: What is the final use? Pdf? …

      (^/)

    • #99608

      A PDF for printing a physical book in CMYK.

    • #99609

      Ok!

      Not sure Theunis’ script could be useful! …

      I think an interesting way could be, after having defined the colors arena on all the book [using formulas in Excel -> export .txt + array in Javascript], to export, page per page, each page (with page number as name, e.g., 001.pdf, 002.pdf, …) changing, before exporting, the values of the color!

      Like this, you could get a beautiful rainbow! =D

      Finally, with Acrobat, rebuild the book in one click!

      (^/)

    • #99611

      Obi-wan, I am just a young padawan… would you mind expanding on your idea?

    • #99613

      You’ll need a script and this script doesn’t exist yet! ;-)

      I do think David will confirm it! …

      (^/)

      • #99616

        I guessed that.

        Not really sure even how to start experimenting with your suggestion but thanks anyway.

    • #99617
      David Blatner
      Keymaster

      Bruno: Obi-wan is a scripter and is available for hire for these kinds of projects. (That’s what he’s hinting at.) :-)

      I think it would also be possible for a custom script to modify the color based on page number. For example, you could make a color swatch with the name “MyColor” and then apply it to the objects on each page. Then create a folder (group) inside the swatches panel with 10 color swatches named 1color, 2color, and so on. Then you could run the script and it would find all the instances of MyColor on page 1 and replace it with 1color, etc.

      (This script doesn’t exist yet, of course, but I’m just imagining one way a script might accomplish this task.)

      I don’t know how hard that would be… if it’s really easy, then maybe someone would write it quickly for free. Or if it’s more challenging then it may require a fee.

      • #99632

        Thanks for clearing that up David. As I said, I am new here and would not know who is who here and, mostly used to platforms like Github, did not think of a hiring option but
        it is good to know — not this idea, intended for a specific book about culture in Brazil, would have a budget for it anyway.

    • #99620

      Bruno,

      I hope you will have news from Chung_Chiang almost 10 years after his only question and only post on Adobe Forums, in answer to your own today demand!

      https://forums.adobe.com/message/9970477?et=watches.email.thread#9970477

      (^/)

      PS: … Such a script could be cool to imagine and, sure!, it will take me less than 10 years to write it! … ;-)

    • #99624

      Even this could be an interesting beginning:

      https://imgur.com/a/Nc4Kj

      … the question needs to be dug deeper for a first and simple reason:

      How do you do with a colorized para between 2 pages!?

      (^/)

      • #99633

        It is hard to know what is behind your exploration but I guess this what you did is almost the whole thing. If you could automatically apply a progression of variable colors to something in a page (a background rectangle?!) it could be applied to any other object.

        Naturally, in this approach, the automatic page numbers would need to be detached from the master pages so they would be just another object like your background.

        I am not sure I understood your question “How do you do with a colorized para between 2 pages!?”. Did you mean “paragraph” when you wrote “para”? This would not be the case, at least in my case, this is specifically intended for the automatic page numbers, not for the overall text/paragraphs, so there would never be anything “between 2 pages”.

        I saw David’s post about you being a scripter for hire and I wish this project had any budget for it but editorial design usually has a limited budget and, when the book is about culture, that just gets an even tighter budget.

    • #99626

      Correction on the first line:

      Even if this could be an interesting beginning: …

    • #99634

      My email is: [email protected]

      (^/)

Viewing 19 reply threads
  • You must be logged in to reply to this topic.
>
Notice: We use cookies on our websites to give you a great online experience. If you keep browsing, we'll assume you're ok with this. For more information, see our privacy policy. By closing this banner, you agree to the use of cookies.I AGREENo