Color.opOpAssign

Overlolad of the +=, -=, and *=` operators.

This operation computes the component-wise sum, subtraction, or multiplication (also called"modulation") of two colors and assigns it to the left operand. 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 opOpAssign(Color otherColor)
    struct Color
    ref
    opOpAssign
    (
    string op
    )
    if (
    (op == "+") ||
    (op == "-")
    ||
    (op == "*")
    )
  2. Color opOpAssign(E num)

Parameters

otherColor
Type: Color

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

Return Value

Type: Color

A reference to this color after performing the addition, subtraction, or multiplication.

Meta