Submit a ticket My Tickets

Change Colours

Using code to let users change colours on the template

  1. Create a colour swatch in InDesign or in Chili - call it something obvious. 
  2. In this example we have two colours that we would like to change simultaneously. The text colour and the block colour.

  3. Apply these to all the elements that you would like to change automatically in the template.

  4. Create a list variable for the user to choose the colours you have predefined.
  5. Under Type Specific create the list of colours you'd like the end user to be able to choose.

  6. Under Actions click the 'Edit' button for On Change.

  7. Here create the code to force the colours to change when the end user chooses from the list.
    If the variable 'Colour' select item name is string 'Red'
    > set the colour 'TextColour' apply from colour = colour 'Red' id
    > set the colour 'BlockColour' apply from colour = colour 'Orange' id

  8. In the Variables tab the end user will now see a list of colours to choose from.
  9. When they choose a colour theme the block colour and the text colour change simultaneously.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.