Color

// RGBA color.
class RVAPI Color
{
public:
    // red component.
    float r;

    // green component.
    float g;

    // blue component.
    float b;

    // alpha component
    float a;

    // Get lumenence.
    float GetLumenence() const;

    // Get sum of colors.
    Color operator + (const Color &color) const { return Color(r + color.r, g + color.g, b + color.b); }

    // Get difference of colors.
    Color operator - (const Color &color) const { return Color(r - color.r, g - color.g, b - color.b); }

    // Get product of colors.
    Color operator * (const Color &color) const { return Color(r * color.r, g * color.g, b * color.b); }

    // Get division of colors.
    Color operator / (const Color &color) const { return Color(r / color.r, g / color.g, b / color.b); }

    // Add [color] to this color.
    Color &operator += (const Color &color) { return *this = *this + color; }

    // Subtract [color] from this color.
    Color &operator -= (const Color &color) { return *this = *this + color; }

    // Multiply [color] and this color.
    Color &operator *= (const Color &color) { return *this = *this + color; }

    // Divide [color] into this color.
    Color &operator /= (const Color &color) { return *this = *this + color; }

    // Normalize color.
    Color &Normalize();

    // Convert color to monochrome.
    Color &Monochrome();

    // Set red, green and blue components.
    Color &SetRGB(float r_, float g_, float b_) { r = r_; g = g_; b = b_; return *this; }

    // Set alpha component.
    Color &SetAlpha(float a_) { a = a_; return *this; }

    // Construct color from components.
    Color(float r, float g, float b, float a = 1) : r(r), g(g), b(b), a(a) {}

    // Construct monochrome color from component value and alpha.
    Color(float n = 0, float a = 1) : r(n), g(n), b(n), a(a) {}

    // Destructor.
    ~Color() {}
};