Class Color

Synopsis

#include <lib/color.hpp>

class Color

Description

Class that represents a color.

Mentioned in

Methods

Color overloadConstruct a new Color object (black).
Color overloadConstruct a new Color object with alpha=1.
Color overloadConstruct a new Color object.
~ColorDestroy the Color object.
setARGBSet ARGB color values.
setRGBSet RGB color values (alpha=1).

Source

Lines 16-67 in lib/color.hpp.

class Color
{
public:
    float a, r, g, b;
    /**
     * @brief Construct a new Color object (black).
     */
    Color();

    /**
     * @brief Construct a new Color object with ``alpha=1``.
     * 
     * @param r Red unitary value.
     * @param g Green unitary value.
     * @param b Blue unitary value.
     */
    Color(float r, float g, float b);

    /**
     * @brief Construct a new Color object.
     * 
     * @param a Alpha unitary value.
     * @param r Red unitary value.
     * @param g Green unitary value.
     * @param b Blue unitary value.
     */
    Color(float a, float r, float g, float b);

    /**
     * @brief Set RGB color values (``alpha=1``).
     * 
     * @param r Red unitary value.
     * @param g Green unitary value.
     * @param b Blue unitary value.
     */
    void setRGB(float r, float g, float b);

    /**
     * @brief Set ARGB color values.
     * 
     * @param a Alpha unitary value.
     * @param r Red unitary value.
     * @param g Green unitary value.
     * @param b Blue unitary value.
     */
    void setARGB(float a, float r, float g, float b);

    /**
     * @brief Destroy the Color object.
     */
    virtual ~Color();
};





Add Discussion as Guest

Log in