#include <color.hpp>
Definition at line 65 of file color.hpp.
Public Member Functions | |
| Color () | |
| Constructor. | |
| Color (int color) | |
| Constructs a color from the bytes in an integer. | |
| Color (int r, int g, int b, int a=255) | |
| Constructor. | |
| Color | operator+ (const Color &color) const |
| Adds the RGB values of two colors together. | |
| Color | operator- (const Color &color) const |
| Subtracts the RGB values of one color from another. | |
| Color | operator * (float value) const |
| Multiplies the RGB values of a color with a float value. | |
| bool | operator== (const Color &color) const |
| Compares two colors. | |
| bool | operator!= (const Color &color) const |
| Compares two colors. | |
Public Attributes | |
| int | r |
| Red color component (range 0-255). | |
| int | g |
| Green color component (range 0-255). | |
| int | b |
| Blue color component (range 0-255). | |
| int | a |
| Color alpha, used for transparency. | |
|
|
Constructor. Initializes the color to black. |
|
|
Constructs a color from the bytes in an integer. Call it with a hexadecimal constant for HTML-style color representation. The alpha component will be set to 255. EXAMPLE: Color(0xff50a0) constructs Gui-chan's favourite color. NOTE: Because of this constructor, integers will be automatically casted to a color by your compiler.
|
|
||||||||||||||||||||
|
Constructor.
|
|
|
Multiplies the RGB values of a color with a float value. The values will be clamped if they go out of range.
|
|
|
Compares two colors.
|
|
|
Adds the RGB values of two colors together. The values will be clamped if they go out of range.
|
|
|
Subtracts the RGB values of one color from another. The values will be clamped if they go out of range.
|
|
|
Compares two colors.
|
|
1.4.1