The Expressions Cheat Sheet

wiggle takes the original value and modifies it to shake over time. How much shake should it add? How fast should it shake? YOU DECIDE!

wiggle(frequency, amplitude);

Play around with the Amplitude and Frequency sliders to get a hang of what they do:


Wiggle listens... Wiggle knows...

Wiggle is always trying to return a value similar to the one the property needs.
On a Rotation property, which is 1 dimensional, wiggle will return a number.
On a Position property or other multi-dimensional properties such as Scale and colors, wiggle will return an array of numbers (one for each dimension)

Wiggle Position

wiggle(5, 45) // [x,y]

Wiggle Position, one dimension only

On a position property wiggle returns two values: [x,y].
We can place the wiggle result in a variable, and then reconstruct a new result, one that retains one of the original value channels.

var w = wiggle(5, 45); // x and y
var result = [ w[0], value[1] ]; // set x from the wiggle result, and y from the original value
result; // apply

To wiggle the Y-axis only:

var w = wiggle(5, 45); // x and y
var result = [ value[0], w[1] ]; // set x from the original value and y from the wiggle result
result; // apply

Wiggle Rotation

wiggle(5, 45) // number

Wiggle Colors

Colors are just arrays, just like points in space. That's why wiggle also works on Color properties.

wiggle(5, 0.5) // [number, number, number, number]

It's important to keep in mind that wiggle manipulates the original value. In order to wiggle a color in the full spectrum you probably want to set the original color value to be perfect gray (#808080) and the  amplitude to 0.5 (like in the code above). Why is that?

Each channel of the color array needs to be a number between 0 and 1. Gray translates to exactly 0.5, which is then manipulated by the wiggle to move 0.5 steps in each direction, which keeps our number in the full spectrum.
That being said I encourage you to experiment with different values and see what happens!