Color class by value built-in
Color with floating-point red, green, blue and alpha channels
Channels are usually in the range 0 to 1. Constructors taking channel values clamp alpha to that range, the other channels are kept as given and arithmetic doesn't clamp at all.
Constructors
- Color(const Color&in)
- Creates a copy of another color
- Color(const vec3&in, float)
- Creates a color from a vector and an alpha value
- Color(const vec4&in)
- Creates a color from a vector
- Color(float, float, float)
- Creates an opaque color from red, green and blue channels
- Color(float, float, float, float)
- Creates a color from red, green, blue and alpha channels
Operators
- Color opAdd(const Color&in color) const +
- Adds two colors channel by channel
- Color& opAddAssign(const Color&in v) += C++
- Adds another color channel by channel in place
- Color& opAssign(const Color&in color) = C++
- Copies another color
- bool opEquals(const Color&in color) const == C++
- Returns whether all four channels are exactly equal
- Color opMul(float scalar) const *
- Multiplies every channel by a number
- Color opMul(const Color&in color) const *
- Multiplies the colors channel by channel
- Color& opMulAssign(float scalar) *= C++
- Multiplies every channel by a number in place
- Color& opMulAssign(const Color&in color) *= C++
- Multiplies by another color channel by channel in place
- Color opSub(const Color&in color) const -
- Subtracts two colors channel by channel
- Color& opSubAssign(const Color&in v) -= C++
- Subtracts another color channel by channel in place