|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
#include <Color.hpp>
Public Types | |
| using | color_val_t = unsigned char |
Public Member Functions | |
| Color (const Color &)=default | |
| Copy constructor. More... | |
| Color (Color &&) noexcept=default | |
| Move constructor. More... | |
| Color & | operator= (const Color &)=default |
| Copy assignment. More... | |
| Color & | operator= (Color &&) noexcept=default |
| Move assignment. More... | |
| ~Color ()=default | |
| Destructor. More... | |
| bool | operator== (const Color &rhs) const |
| Check whether two colors are equal. More... | |
| bool | operator!= (const Color &rhs) const |
| Check whether two colors are not equal. More... | |
Constructors | |
Constructs a new Color object. | |
| Color () | |
| Default constructor. More... | |
| Color (const int r, const int g, const int b, const int a=100) | |
| Constructor for integer R,G,B,A values. More... | |
| Color (const double r, const double g, const double b, const double a=1.0) | |
| Constructor for separate double R,G,B,A values. More... | |
| Color (const unsigned int hex, const unsigned int a=0x64) | |
| Constructor for combined hexadecimal R,G,B,A values. More... | |
| Color (const char *name, color_val_t a=100) | |
| Constructor for combined hexadecimal R,G,B,A values. More... | |
Read access to stored RGBA color values. | |
Getters for stored color values. | |
| std::string | RGBA () const |
| Gets the hexadecimal value of the RGBA color as a string. More... | |
| std::string | RGB () const |
| Gets the hexadecimal value of the RGB color as a string. More... | |
| int | hex () const |
| Gets the hexadecimal value of the RGBA color. More... | |
| color_val_t | r () const |
| Gets the red value of the RGBA color. More... | |
| color_val_t | g () const |
| Gets the green value of the RGBA color. More... | |
| color_val_t | b () const |
| Gets the blue value of the RGBA color. More... | |
| color_val_t | a () const |
| Gets the alpha/opacity value of the RGBA color. More... | |
Write access to stored RGBA color values. | |
Setters for stored color values Takes the new value for the red/blue/green/alpha respectively. | |
| void | hex (const int hex) |
| Sets all values of the RGBA color. More... | |
| void | hex (const int hex, const unsigned int a) |
| Sets all values of the RGBA color. More... | |
| void | r (color_val_t r) |
| Sets the red value of the RGBA color. More... | |
| void | g (color_val_t g) |
| Sets the green value of the RGBA color. More... | |
| void | b (color_val_t b) |
| Sets the blue value of the RGBA color. More... | |
| void | a (color_val_t a) |
| Sets the alpha/opacity value of the RGBA color. More... | |
Private Attributes | |
| color_val_t | r_ |
Red value. . More... | |
| color_val_t | g_ |
Green value. . More... | |
| color_val_t | b_ |
Blue value. . More... | |
| color_val_t | a_ |
Alpha/opacity value. . More... | |
Stores an RGBA Color.
| using gl::Color::color_val_t = unsigned char |
color value type, has a range of exactly
|
inline |
Default constructor.
|
inline |
Constructor for integer R,G,B,A values.
| [in] | r | R value. |
| [in] | g | G value. |
| [in] | b | B value. |
| [in] | a | Alpha value. |
|
inline |
Constructor for separate double R,G,B,A values.
| [in] | r | R value. |
| [in] | g | G value. |
| [in] | b | B value. |
| [in] | a | Alpha value. |
|
inlineexplicit |
Constructor for combined hexadecimal R,G,B,A values.
| [in] | hex | Hexadecimal color code. Format: where signify the red, blue and green bytes. |
| [in] | a | Hexadecimal color code for A value. Format: where is optional and signifies the alpha (opacity) byte. |
|
inline |
Constructor for combined hexadecimal R,G,B,A values.
| [in] | name | Name of color. Available are the following: |
| [in] | a | (optional) Opacity of the color. |
|
default |
Copy constructor.
|
defaultnoexcept |
Move constructor.
|
default |
Destructor.
|
inline |
Check whether two colors are equal.
|
inline |
Check whether two colors are not equal.
|
inline |
Gets the hexadecimal value of the RGBA color as a string.
|
inline |
Gets the hexadecimal value of the RGB color as a string.
|
inline |
Gets the hexadecimal value of the RGBA color.
|
inline |
Gets the red value of the RGBA color.
|
inline |
Gets the green value of the RGBA color.
|
inline |
Gets the blue value of the RGBA color.
|
inline |
Gets the alpha/opacity value of the RGBA color.
|
inline |
Sets all values of the RGBA color.
| [in] | hex | New hexadecimal color code (0xRRGGBB). |
|
inline |
Sets all values of the RGBA color.
| [in] | hex | New hexadecimal color code (0xRRGGBB). |
| [in] | a | Optional new alpha/opacity value (0xAA). |
|
inline |
Sets the red value of the RGBA color.
|
inline |
Sets the green value of the RGBA color.
|
inline |
Sets the blue value of the RGBA color.
|
inline |
Sets the alpha/opacity value of the RGBA color.
|
private |
Red value.
.
|
private |
Green value.
.
|
private |
Blue value.
.
|
private |
Alpha/opacity value.
.