Neon Expressions

After Effects
Photoshop
Summary

This project was to utilize AfterEffects expressions to an element as a means of practicing the concept. Taking inspiration from neon signage, I decided to develop this quasi-realistic rendering of my logo as if it were a neon sign, and then the expressions were used to apply animation to it. I made this using AfterEffects, and during the development process, I learned about the use of JavaScript within AfterEffects.

Code

To control the color of the the neon sign, I applied the following code to one shape's stroke color, and then pick whipped the rest of the shape stroke colors to it.

rgb = content("Shape 1").content("Fill 1").color;
hue = parseFloat(thisComp.layer("Hue").text.sourceText);
saturation = parseFloat(thisComp.layer("Saturation").text.sourceText);
lightness = parseFloat(thisComp.layer("Lightness").text.sourceText);
hsl = rgbToHsl(rgb);
changeHsl = [(hue/360) , (saturation/100) , (lightness/100) , hsl[3]];
hslToRgb(changeHsl);

Hue, Saturation, and Brightness are hidden text layers that I am using to control the color value. However I also wanted expression controls on the source text values to fine tune the color transformation, so I added a Slider Control effect to each of the text layers and applied the following code in the source text.

effect("Slider Control")("Slider")

Keep in mind that the values of the corresponding text layers have to remain within the parameters set by the fractions within the changeHsl layer. For example, the value of the Hue layer cannot equal to or exceed 360.

Then to animate the flicker, I added keyframes to the Hue slider for a realistic color change, and then put the following code in the slider control of the Saturation Layer, and pickwhipped the slider control of the Lightness layer to that code as well.

high = 50;
decay = 2;
angle = 10;
frequency = 20;
(high*Math.exp(-decay*time)*Math.cos((frequency*time)+angle))+45

This code enables a damped sine wave that simulates the flickering of a neon light, and then I layered the entire composition together to result in this final look.

PAGES

SOCIAL MEDIA