The outputs are the variables that control the look and behaviour of each individual element.
Output | Description |
---|---|
x' | Horizontal coordinate of the element on a canvas. |
y' | Vertical coordinate of the element on a canvas. |
h | The color hue, ranging from 0° to 360°. This value is always remapped to this range. |
s | The color saturation, ranging from 0 to 1. |
l | The color value (lightness), ranging from 0 to 1. |
a | The alpha channel value, ranging from 0 to 1. |
These are read-only variables that you can feed into the output expressions.
Input | Description |
---|---|
x | The initial horizontal coordinate of the element on a canvas. |
y | The initial vertical coordinate of the element on a canvas. |
index | The unique number associated with the current element (starts from 0). |
count | The total amount of simulated elements. |
fraction | Value of 'index' divided by 'count'. |
size | Size of simulated elements. |
pi | 3.14159265358979323846264338327950288419716... |
tau | Two times pi. |
time | The current time, in seconds, on the local system. |
simulationTime | The time, in seconds, since the expression was activated. |
simulationStartTime | The time, in seconds, when the expression was activated. |
width | The width of simulation canvas in pixels. |
height | The height of simulation canvas in pixels. |
Some usefull built-in functions to use in the expressions.
Function | Description |
---|---|
sin(angle) | Returns the sine of 'angle'. |
cos(angle) | Returns the cosine of 'angle'. |
tan(angle) | Returns the tangent of 'angle'. |
asin(float) | Returns the arcsine of 'float'. |
acos(float) | Returns the arccosine of 'float'. |
atan(float) | Returns the arctangent of 'float'. |
atan2(x, y) | Returns the arctangent of 'y' divided by 'x'. |
sqrt(float) | Returns the square-root of 'float'. |
min(a, b) | Returns the smaller value of 'a' or 'b'. |
max(a, b) | Returns the larger value of 'a' or 'b' |
floor(float) | Returns the value 'float' rounded down to the nearest whole number less than 'float' |
ceil(float) | Returns the value 'float' rounded up to the nearest whole number greater than 'float' |
round(float) | Returns the value 'float' rounded to the nearest whole number. |
abs(float) | Returns the absolute value of 'float' ('float' < 0 ? -'float' : 'float'). |
rand() | Returns a random number between 0.0 and 1.0. |
if(float, a, b) | Returns 'a' if 'float' is not zero otherwise returns b. |
lerp(frac, a, b) | Interpolates between 'a' and 'b' using 'frac' (a * frac + b * (1 - frac)). |
Basic math and logic operations to use in the expressions.
Operator | Description |
---|---|
= | Assigns the value of the right operand to the left operand. |
+ | Returns the sum of the left and right operands. |
- | Returns the left subtract the right operand. |
* | Returns the product of the left and right operands. |
/ | Returns the left divided by the right operand. |
^ | Returns the left operand to the power of the right operand. |
% | Returns the remainder of the left operand divided by the right operand. |
< | Returns 1 when the left operand is less than the right, otherwise returns 0. |
> | Returns 1 when the left operand is greater than the right, otherwise returns 0. |
>= | Returns 0 when the left operand is less than the right, otherwise returns 1. |
<= | Returns 0 when the left operand is greater than the right, otherwise returns 1. |
== | Returns 1 when the left operand is equal to the right, otherwise returns 0. |
!= | Returns 0 when the left operand is equal to the right, otherwise returns 1. |
& | Returns 1 if both the left side and right side are not zero. |
| | Returns 1 if either the left side and right side are not zero. |
! | Returns 1 if the expression is zero and 0 if the expression is not zero. |
# | Starts a comment. |
() | Can be used to group sub-expressions. |