TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

enum ColorOp in Tinman.Core.Util

Enumeration of color operations.

[PersistentEnum]
enum ColorOp  

Items

Add = 0

Adds the color channel components of the given color values.

Remarks:

For each color component, the following computation is performed, assuming color channel values in the range [0..1]:

result := min(first + second, 1);

See also:

Colors.Add
Blend = 1

Blends the color values according to their alpha channel values (second over first).

Remarks:

The following computations are performed, assuming color channel values in the range [0..1]:

temp       := first.a * (1 - second.a)
result.a   := second.a + temp
result.rgb := (first.rgb * temp + second.rgb * second.a) / result.a;
When the first color is opaque, the computation reduces to this:
result.a   := 1
result.rgb := first.rgb * (1 - second.a) + second.rgb * second.a;

See also:

Colors.Blend
Mul = 2

Multiplies the color channel components of the given color values.

Remarks:

For each color component, the following computation is performed, assuming color channel values in the range [0..1]:

result := first * second;

See also:

Colors.Mul
Sub = 3

Subtracts the color channel components of the given color values.

Remarks:

For each color component, the following computation is performed, assuming color channel values in the range [0..1]:

result := max(first - second, 0);

See also:

Colors.Sub