Arithmetic Nodes
Number, vector, and color math: add, subtract, multiply, divide, mix, power, and remainder.
This category contains 14 nodes.
Nodes
Add
Adds two numbers.
Inputs: Two numbers to add.
| Name | Type | Range | Default |
|---|---|---|---|
| A | Number | any | 0 |
| B | Number | any | 0 |
Outputs: The sum.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Add Color
Adds two colors. Use it to layer light effects. If one input is a Channels color and the other is portable, Spectralite first converts the Channels side to a portable color. The conversion keeps only its red, green, blue, white, and amber. See Color.
Inputs: The two colors to add.
| Name | Type | Range | Default |
|---|---|---|---|
| Color 1 | Color | color | [0, 0, 0, 0, 0, 0] |
| Color 2 | Color | color | [0, 0, 0, 0, 0, 0] |
Outputs: The combined color, with each channel the sum of the two inputs.
| Name | Type | Range |
|---|---|---|
| Color | Color | color |
Add Vectors
Adds two positions. Use it for offsets or to combine movements.
Inputs: The two positions to add.
| Name | Type | Range | Default |
|---|---|---|---|
| Vector A | Vector | vec | [0, 0, 0] |
| Vector B | Vector | vec | [0, 0, 0] |
Outputs: The combined position.
| Name | Type | Range |
|---|---|---|
| Vector | Vector | vec |
Divide
Divides A by B. Returns 0 if B is zero.
Inputs: A divided by B.
| Name | Type | Range | Default |
|---|---|---|---|
| A | Number | any | 0 |
| B | Number | any | 1 |
Outputs: The quotient.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Mix Color
Blends between two colors. A ratio of 0 outputs Color 1, a ratio of 1 outputs Color 2, and values in between blend the two smoothly. If one input is a Channels color and the other is portable, Spectralite first converts the Channels side to a portable color. The conversion keeps only its red, green, blue, white, and amber. See Color.
Inputs: The blend ratio (0 to 1) and the two colors to blend between.
| Name | Type | Range | Default |
|---|---|---|---|
| Ratio | Number | 0-1 | 0.5 |
| Color 1 | Color | color | [255, 0, 0, 0, 0, 0] |
| Color 2 | Color | color | [0, 255, 0, 0, 0, 0] |
Outputs: The blended color.
| Name | Type | Range |
|---|---|---|
| Color | Color | color |
Mix Number
Blends between two numbers. A ratio of 0 gives the first value, 1 gives the second, and 0.5 gives the value halfway between.
Inputs: The two values and the blend ratio (0-1).
| Name | Type | Range | Default |
|---|---|---|---|
| Ratio | Number | 0-1 | 0.5 |
| Value 1 | Number | any | 0 |
| Value 2 | Number | any | 1 |
Outputs: The blended value.
| Name | Type | Range |
|---|---|---|
| Value | Number | any |
Mix Vector
Blends between two positions. A ratio of 0 gives the first, 1 gives the second, and 0.5 gives the midpoint.
Inputs: The two positions and the blend ratio (0-1).
| Name | Type | Range | Default |
|---|---|---|---|
| Ratio | Number | 0-1 | 0.5 |
| Vector A | Vector | vec | [0, 0, 0] |
| Vector B | Vector | vec | [1, 1, 1] |
Outputs: The blended position.
| Name | Type | Range |
|---|---|---|
| Vector | Vector | vec |
Multiply
Multiplies two numbers.
Inputs: The two numbers to multiply.
| Name | Type | Range | Default |
|---|---|---|---|
| A | Number | any | 0 |
| B | Number | any | 0 |
Outputs: The product.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Multiply Vector
Scales a position by a number. Multiply by 2 to double it, or by 0.5 to halve it.
Inputs: A position and a scale factor.
| Name | Type | Range | Default |
|---|---|---|---|
| Vector | Vector | vec | [0, 0, 0] |
| Scalar | Number | any | 0 |
Outputs: The scaled position.
| Name | Type | Range |
|---|---|---|
| Vector | Vector | vec |
Power
Raises a number to a power. An exponent of 2 squares the base, and 0.5 takes its square root. A negative base keeps its sign under an odd whole power and gives 0 under a fractional one.
Inputs: The base and the exponent.
| Name | Type | Range | Default |
|---|---|---|---|
| Base | Number | any | 2 |
| Exponent | Number | any | 1 |
Outputs: Base raised to the exponent.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Power Vector
Raises each base component to the matching exponent component, so each axis has its own power. A negative component keeps its sign under an odd whole power and gives 0 under a fractional one.
Inputs: The base and the exponent for each axis.
| Name | Type | Range | Default |
|---|---|---|---|
| Base | Vector | vec | [2, 2, 2] |
| Exponent | Vector | vec | [1, 1, 1] |
Outputs: A vector of each base component raised to its exponent.
| Name | Type | Range |
|---|---|---|
| Vector | Vector | vec |
Remainder
Returns the remainder of A divided by B, so 10 mod 3 gives 1. Use it to build repeating patterns.
Inputs: The number to divide and the divisor.
| Name | Type | Range | Default |
|---|---|---|---|
| A | Number | any | 0 |
| B | Number | any | 1 |
Outputs: The remainder after division.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Subtract
Subtracts B from A.
Inputs: A minus B.
| Name | Type | Range | Default |
|---|---|---|---|
| A | Number | any | 0 |
| B | Number | any | 0 |
Outputs: The difference.
| Name | Type | Range |
|---|---|---|
| Number | Number | any |
Subtract Vector
Subtracts one position from another. Use it to find the direction or offset between two points.
Inputs: Two positions, as A minus B.
| Name | Type | Range | Default |
|---|---|---|---|
| Vector A | Vector | vec | [0, 0, 0] |
| Vector B | Vector | vec | [0, 0, 0] |
Outputs: The difference between the positions.
| Name | Type | Range |
|---|---|---|
| Vector | Vector | vec |