rag
graphic 2d engine
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
rag::Color Class Reference

Represents RGBA color. More...

#include <Color.h>

Public Member Functions

 Color (float r=1, float g=1, float b=1, float a=1)
 Construts a Color object default to white.
 
 Color (std::string color)
 Construts a Color object with a string representing the color in hexadecimal. More...
 
unsigned int toRGBA () const
 Writes the color in a single 32 bit int.
 
unsigned int toABGR () const
 Writes the color in a single 32 bit int reversed.
 
Coloroperator*= (const Color &rhs)
 
Coloroperator*= (float value)
 
Coloroperator/= (const Color &rhs)
 
Coloroperator/= (float value)
 
Coloroperator+= (const Color &rhs)
 
const Color operator* (const Color &rhs) const
 
const Color operator* (float value) const
 
const Color operator/ (const Color &rhs) const
 
const Color operator/ (float value) const
 
const Color operator+ (const Color &rhs) const
 
bool operator== (const Color &rhs)
 
bool operator!= (const Color &rhs)
 
std::string toString ()
 Returns a string representation of the Color object.
 

Static Public Member Functions

static unsigned int createRGBA (int r, int g, int b, int a)
 Returns an unsigned int from color values.
 
static unsigned int createABGR (int r, int g, int b, int a)
 Returns an unsigned int from color values.
 

Public Attributes

float r
 
float g
 
float b
 
float a
 

Static Public Attributes

static const Color black
 
static const Color white
 

Detailed Description

Represents RGBA color.

Provides functionality to operate with colors.

Constructor & Destructor Documentation

Color::Color ( std::string  color)

Construts a Color object with a string representing the color in hexadecimal.

The expected format of the string is like [x|#]RRGGBB[AA].


The documentation for this class was generated from the following files: