SDL Utility
|
A structure holding color data. More...
#include <Color.hpp>
Public Member Functions | |
Color () | |
Default constructor (Black) More... | |
Color (Uint8 r, Uint8 g, Uint8 b, Uint8 a=255) | |
Construct color from four 8-Bit integer values. More... | |
Color (Uint32 color) | |
Construct color from a 32-Bit integer value. More... | |
Uint32 | ToInt () |
Returns color data as a 32-Bit integer. More... | |
Static Public Member Functions | |
static Color | FromHSV (Uint16 h, Uint8 s, Uint8 v) |
Generate color from HSV values. More... | |
Public Attributes | |
Uint8 | r |
Red component. More... | |
Uint8 | g |
Green component. More... | |
Uint8 | b |
Blue component. More... | |
Uint8 | a |
Alpha component. More... | |
Static Public Attributes | |
static const Color | Black |
Default Color Black (#000000FF) More... | |
static const Color | Red |
Default Color Red (#FF0000FF) More... | |
static const Color | Green |
Default Color Green (#00FF00FF) More... | |
static const Color | Blue |
Default Color Blue (#0000FFFF) More... | |
static const Color | Yellow |
Default Color Yellow (#FFFF00FF) More... | |
static const Color | Magenta |
Default Color Magenta (#FF00FFFF) More... | |
static const Color | Cyan |
Default Color Cyan (#00FFFFFF) More... | |
static const Color | White |
Default Color White (#FFFFFFFF) More... | |
static const Color | Transparent |
Default Color Transparent (#00000000) More... | |
Friends | |
Color | operator+ (const Color &left, const Color &right) |
Componentwise color addition. More... | |
Color | operator- (const Color &left, const Color &right) |
Componentwise color subtraction. More... | |
Color | operator* (const Color &left, const Color &right) |
Componentwise color multiplication. More... | |
Color | operator/ (const Color &left, const Color &right) |
Componentwise color division. More... | |
Color & | operator+= (Color &left, const Color &right) |
Componentwise color addition. More... | |
Color & | operator-= (Color &left, const Color &right) |
Componentwise color subtraction. More... | |
Color & | operator*= (Color &left, const Color &right) |
Componentwise color multiplication. More... | |
Color & | operator/= (Color &left, const Color &right) |
Componentwise color division. More... | |
bool | operator== (const Color &left, const Color &right) |
Componentwise color comparison. More... | |
bool | operator!= (const Color &left, const Color &right) |
Componentwise color comparison. More... | |
A structure holding color data.
This struct allows for the easy passing of color data between objects or functions. It holds RGBA values and allows for arithmetical operations.
Color::Color | ( | ) |
Default constructor (Black)
Construct color from four 8-Bit integer values.
[in] | r | Red component |
[in] | g | Green component |
[in] | b | Blue component |
[in] | a | Alpha component |
Color::Color | ( | Uint32 | color | ) |
Construct color from a 32-Bit integer value.
[in] | color | The color data structured as RGBA |
Generate color from HSV values.
Uint32 Color::ToInt | ( | ) |
Returns color data as a 32-Bit integer.
Componentwise color comparison.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color multiplication.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color multiplication.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color addition.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color addition.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color subtraction.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color subtraction.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color division.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color division.
[in] | left | Left operand |
[in] | right | Right operand |
Componentwise color comparison.
[in] | left | Left operand |
[in] | right | Right operand |
Uint8 Color::a |
Alpha component.
Uint8 Color::b |
Blue component.
Uint8 Color::g |
Green component.
Uint8 Color::r |
Red component.