libAlgAudio
v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
|
#include <Color.hpp>
Public Member Functions | |
constexpr | Color (unsigned char R, unsigned char G, unsigned char B, unsigned char A=255) |
constexpr | Color (unsigned int hex) |
Color () | |
Color | Darker (double amount) const |
Color | Lighter (double amount) const |
operator SDL_Color () const | |
SDL_Color | SDL () const |
Color | SetAlpha (float a_) const |
std::string | ToString () |
Color | ZeroAlpha () const |
Public Attributes | |
unsigned char | alpha |
unsigned char | b |
unsigned char | g |
unsigned char | r |
A handy class for representin colors and operations on them.
|
inline |
Constructs a new color instance using the given values.
|
inline |
Constructs a new color instance from a hex code. For example, 0x01020304 will get interpreted as r=1, g=2, b=3, a=4.
|
inline |
Color AlgAudio::Color::Darker | ( | double | amount | ) | const |
Returns a new color darker than this one by the given amount.
Color AlgAudio::Color::Lighter | ( | double | amount | ) | const |
Returns a new color lighter than this one by the given amount.
AlgAudio::Color::operator SDL_Color | ( | ) | const |
SDL_Color AlgAudio::Color::SDL | ( | ) | const |
Conversion to SDL_Color struct.
|
inline |
Returns a new color with alpha set to the desired value.
|
inline |
For prettyprinting colors.
|
inline |
Returns a new color with alpha reset to 0
unsigned char AlgAudio::Color::alpha |
unsigned char AlgAudio::Color::b |
unsigned char AlgAudio::Color::g |
unsigned char AlgAudio::Color::r |