-
Error fallback method(s)
My default template uses a ‘master color comp’ with a series of colors, (ColorControl_01, ColorControl_02, etc)
Normally a project will start with a series of brand colors, and as it develops, the colors will shift slightly by way of the brand guidelines being updated by the client/agency.
I’ve been using a system that pulls the desired colors from the color comp with the expression:
var colorNum = thisLayer.name.split(" ")[0];
comp("_colorMaster").layer("ColorMaster").effect("ColorControl_"+colorNum)("Color");So the layer name determines the color of the fill, IF the first two characters of the layer name are numbers, followed by a space. What I would like to do is create a fallback so that if the layer name does NOT start with two numbers, it will disable the expression, (or render with #00FF33 ??)
It seems to be an if/than situation, but evaluating the characters seems to be where I am getting stuck.
Thanks in advance