Learn how to create a color palette/swatches to make a master control for your compositions colors
If you are an absolute beginner, please start your learning by checking the essential resources below:
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
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
- Then on the Anchor Point, add another expression
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
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
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)
- To loop the colors, enter the result
Modulo starts from zero but the color palette range starts at one, hence +1
build your own presets collection to speed up your workflow