sf::Color Class Reference
Color is an utility class for manipulating 32-bits RGBA colors.
More...
#include <Color.hpp>
List of all members.
|
Public Member Functions |
| Color () |
| Default constructor.
|
| Color (Uint8 R, Uint8 G, Uint8 B, Uint8 A=255) |
| Construct the color from its 4 RGBA components.
|
Color & | operator+= (const Color &Other) |
| Operator += overload to add a color.
|
Color & | operator*= (const Color &Other) |
| Operator *= overload to modulate a color.
|
bool | operator== (const Color &Other) const |
| Compare two colors (for equality).
|
bool | operator!= (const Color &Other) const |
| Compare two colors (for difference).
|
Public Attributes |
Uint8 | r |
| Red component.
|
Uint8 | g |
| Green component.
|
Uint8 | b |
| Blue component.
|
Uint8 | a |
| Alpha (transparency) component.
|
Static Public Attributes |
static const Color | Black |
| Black predefined color.
|
static const Color | White |
| White predefined color.
|
static const Color | Red |
| Red predefined color.
|
static const Color | Green |
| Green predefined color.
|
static const Color | Blue |
| Blue predefined color.
|
static const Color | Yellow |
| Yellow predefined color.
|
static const Color | Magenta |
| Magenta predefined color.
|
static const Color | Cyan |
| Cyan predefined color.
|
Detailed Description
Color is an utility class for manipulating 32-bits RGBA colors.
Definition at line 40 of file Color.hpp.
Constructor & Destructor Documentation
Default constructor.
Definition at line 50 of file Color.cpp.
sf::Color::Color |
( |
Uint8 |
R, |
|
|
Uint8 |
G, |
|
|
Uint8 |
B, |
|
|
Uint8 |
A = 255 | |
|
) |
| | |
Construct the color from its 4 RGBA components.
- Parameters:
-
| R | : Red component (0 .. 255) |
| G | : Green component (0 .. 255) |
| B | : Blue component (0 .. 255) |
| A | : Alpha component (0 .. 255) (255 by default) |
Definition at line 63 of file Color.cpp.
Member Function Documentation
bool sf::Color::operator!= |
( |
const Color & |
Other |
) |
const |
Compare two colors (for difference).
- Parameters:
-
- Returns:
- True if colors are different
Definition at line 113 of file Color.cpp.
Color & sf::Color::operator*= |
( |
const Color & |
Other |
) |
|
Operator *= overload to modulate a color.
- Parameters:
-
| Other | : Color to modulate |
- Returns:
- Component-wise multiplication of the two colors
Definition at line 90 of file Color.cpp.
Color & sf::Color::operator+= |
( |
const Color & |
Other |
) |
|
Operator += overload to add a color.
- Parameters:
-
- Returns:
- Component-wise saturated addition of the two colors
Definition at line 76 of file Color.cpp.
bool sf::Color::operator== |
( |
const Color & |
Other |
) |
const |
Compare two colors (for equality).
- Parameters:
-
- Returns:
- True if colors are equal
Definition at line 104 of file Color.cpp.
Member Data Documentation
Alpha (transparency) component.
Definition at line 119 of file Color.hpp.
Black predefined color.
Definition at line 104 of file Color.hpp.
Blue predefined color.
Definition at line 108 of file Color.hpp.
Cyan predefined color.
Definition at line 111 of file Color.hpp.
Green predefined color.
Definition at line 107 of file Color.hpp.
Magenta predefined color.
Definition at line 110 of file Color.hpp.
Red predefined color.
Definition at line 106 of file Color.hpp.
White predefined color.
Definition at line 105 of file Color.hpp.
Yellow predefined color.
Definition at line 109 of file Color.hpp.
The documentation for this class was generated from the following files: