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

A mix-in module defining color arithmetic operations.

Methods

*   *   +   +   -   -   /   /   average   average   over   over  

Public Instance methods

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

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

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

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

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

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

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

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

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.

Layer this color over another color.

Layer this color over another color.

[Validate]