Skip to main content
Documentation
Node Editor

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.

NameTypeRangeDefault
ANumberany0
BNumberany0

Outputs: The sum.

NameTypeRange
NumberNumberany

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.

NameTypeRangeDefault
Color 1Colorcolor[0, 0, 0, 0, 0, 0]
Color 2Colorcolor[0, 0, 0, 0, 0, 0]

Outputs: The combined color, with each channel the sum of the two inputs.

NameTypeRange
ColorColorcolor

Add Vectors

Adds two positions. Use it for offsets or to combine movements.

Inputs: The two positions to add.

NameTypeRangeDefault
Vector AVectorvec[0, 0, 0]
Vector BVectorvec[0, 0, 0]

Outputs: The combined position.

NameTypeRange
VectorVectorvec

Divide

Divides A by B. Returns 0 if B is zero.

Inputs: A divided by B.

NameTypeRangeDefault
ANumberany0
BNumberany1

Outputs: The quotient.

NameTypeRange
NumberNumberany

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.

NameTypeRangeDefault
RatioNumber0-10.5
Color 1Colorcolor[255, 0, 0, 0, 0, 0]
Color 2Colorcolor[0, 255, 0, 0, 0, 0]

Outputs: The blended color.

NameTypeRange
ColorColorcolor

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).

NameTypeRangeDefault
RatioNumber0-10.5
Value 1Numberany0
Value 2Numberany1

Outputs: The blended value.

NameTypeRange
ValueNumberany

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).

NameTypeRangeDefault
RatioNumber0-10.5
Vector AVectorvec[0, 0, 0]
Vector BVectorvec[1, 1, 1]

Outputs: The blended position.

NameTypeRange
VectorVectorvec

Multiply

Multiplies two numbers.

Inputs: The two numbers to multiply.

NameTypeRangeDefault
ANumberany0
BNumberany0

Outputs: The product.

NameTypeRange
NumberNumberany

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.

NameTypeRangeDefault
VectorVectorvec[0, 0, 0]
ScalarNumberany0

Outputs: The scaled position.

NameTypeRange
VectorVectorvec

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.

NameTypeRangeDefault
BaseNumberany2
ExponentNumberany1

Outputs: Base raised to the exponent.

NameTypeRange
NumberNumberany

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.

NameTypeRangeDefault
BaseVectorvec[2, 2, 2]
ExponentVectorvec[1, 1, 1]

Outputs: A vector of each base component raised to its exponent.

NameTypeRange
VectorVectorvec

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.

NameTypeRangeDefault
ANumberany0
BNumberany1

Outputs: The remainder after division.

NameTypeRange
NumberNumberany

Subtract

Subtracts B from A.

Inputs: A minus B.

NameTypeRangeDefault
ANumberany0
BNumberany0

Outputs: The difference.

NameTypeRange
NumberNumberany

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.

NameTypeRangeDefault
Vector AVectorvec[0, 0, 0]
Vector BVectorvec[0, 0, 0]

Outputs: The difference between the positions.

NameTypeRange
VectorVectorvec