Color.opBinary

Overlolad of the +, -, and * operators.

This operator returns the component-wise sum, subtraction, or multiplication (also called"modulation") of two colors.

For addition and subtraction, components that exceed 255 are clamped to 255 and those below 0 are clamped to 0. For multiplication, are divided by 255 so that the result is still in the range [0, 255].

  1. Color opBinary(Color otherColor)
    struct Color
    opBinary
    const
    (
    string op
    )
    if (
    (op == "+") ||
    (op == "-")
    ||
    (op == "*")
    )
  2. Color opBinary(E num)

Parameters

otherColor
Type: Color

The Color to be added to/subtracted from/bultiplied by this one

Return Value

Type: Color

The addition, subtraction, or multiplication between this Color and the other.

Meta