Lesson07 – Color Palette / Swatches

Learn how to create a color palette/swatches to make a master control for your compositions colors

REMINDER
If you are an absolute beginner, please start your learning by checking the essential resources below:
http://www.jjgifford.com/expressions/basics/index.html
https://helpx.adobe.com/after-effects/using/expression-basics.html
http://www.motionscript.com

1. Color Swatches

  • Create a new Shape Layer and rename it to “colors”
  • Add an empty Group and rename it to “swatches”
  • Add a Group to Shape Layer(“colors”)> group(“swatches”) and rename it to “01
  • Add a Rectangle Path and a Color Fill to Shape Layer(“colors”)> group(“swatches”)> group(“01”)

Each rectangle will be a color swatch for the composition (and pre-comps too).

  • To automatically align duplicate of the swatch, add an expression to Shape Layer(“colors”)> group(“swatches”)> group(“01”)> Transform> Position
.propertyIndex
retrieves the index of the targeted property.
Note that Indexes increment as you duplicate them,
while numerical names keep the same value.
var x=content(“swatches”).content(“01”).content(“Rectangle Path 1”).size[0]*(thisProperty.propertyGroup(2).propertyIndex-1);
[x, value[1]]

Use the pickwhip to retrieve the path to the Rectange Path Size. With propertyGroup, get the index of the group and use shift the position of each (Check lesson04 to review propertyGroup argument)

  • To automatically position the color palette on the left corner, add an expression to Shape Layer(“colors”)> group(“swatches”)> Transform> Position
width gets the composition width
height gets the composition height
[-width/2,height/2]
  • Then on the Anchor Point, add another expression
var s=content(“swatches”).content(“01”).content(“Rectangle Path 1”).size[0];
[-s/2,s/2]

Use the pickwhip to retrieve the path to the Rectange Path Size.

Now duplicate the group(“01”) as many times as you want to create more swatches.
By changing the Shape Layer(“colors”)> group(“swatches”)> Transform> Scale , you can resize the color palette.

By making it a Guide Layer, while still showing up in the composition, I will be ignored when rendering without having to hide it.
Changes the colors to your client’s graphic guidelines, or use Window> Extensions> Adobe color themes to pick pre-made color schemes.

2. Link colors

Now each time you create a new Shape Layer, add a color correction filter or create a Solid Layer, you can link it to the corresponding color.

  • Create a new Polygon Shape Layer by click-holding the shape layer icon in the tool bar and polygon tool in the drop-down menu
  • Navigate down to the Fill property and rename it to “01”
  • Add an expression to the Fill Color
var select = thisProperty.propertyGroup(1).name;
thisComp.layer(“colors”).content(“swatches”).content(select).content(“Fill 1”).color

Use the pickwhip to retrieve the path to the 1st swatch fill color in Shape Layer(“colors”)> group(“swatches”)> group(“01”)> Fill 1> Color , then change (“01”) to (select)

By changing the name of the shape group to “02”,”03″,”04″… you’ll be adjusting the color.
Save the expression as a preset to easily apply the expression to all you colors.

For filters using colors, remember to rename the filter’s name instead.
You can also prefer to manually adjsut the expression rather than using the filters/layers/groups names, that is your call.

3. Auto-cyle colors

Let’s say we plan on creating a delay with multiples groups in a shape layer, and that we would like to have the instances to each have a different color.

  • First we need to know how many swatches in the palette
.numProperties
returns how many properties populates the group
var count = thisComp.layer(“colors”).content(“swatches”).content(“01”).propertyGroup(1).numProperties;
var select = thisProperty.propertyGroup(3).name;

Note that because we will duplicate the whole group, the color index this time is linked to the group name at .propertyGroup(3)

Modulo (value % threshold)
is a division reminder;
you can understand it as a loop operator:
each time a value reaches the threshold,
it will start again from 0.
0%5 = 5%5 = 10%5 = 0
1%5 = 6%5 = 11%5 = 1

4%5 = 8%5 = 14%5 = 5
  • To loop the colors, enter the result
thisComp.layer(“colors”).content(“swatches”)­.content(select%count+1).content(“Fill 1”).color

Modulo starts from zero but the color palette range starts at one, hence +1

DON’T FORGET

build your own presets collection to speed up your workflow

Click icon below to download presets (rename .key to .zip after download) download

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s