Module | Rubygame::Color::ColorBase
In: | lib/rubygame/color/models/base.rb

A mix-in module defining color arithmetic operations.

### Methods

* + - / average over

### Public Instance methods

*(other)

Perform color multiplication with another color of any type. The alpha of the new color will be equal to the alpha of the receiver.

+(other)

Perform color addition with another color of any type. The alpha of the new color will be equal to the alpha of the receiver.

-(other)

Perform color subtraction with another color of any type. The alpha of the new color will be equal to the alpha of the receiver.

/(other)

Perform color division with another color of any type. The alpha of the new color will be equal to the alpha of the receiver.

average(other, weight=0.5)

Average this color with another color. (Linear weighted average)

A weight of 0.0 means 0% of this color, 100% of the other. A weight of 1.0 means 100% of this color, 0% of the other. A weight of 0.5 means 50% of each color.

over(other)

Layer this color over another color.

[Validate]