Pixel Dust Game Engine  v0.9.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Color Struct Reference

Public Member Functions

 Color ()
 create a new black color object
 
 Color (int r, int g, int b)
 create a new color with the RGB values specified
 
 Color (float r, float g, float b)
 
 Color (int r, int g, int b, int a)
 create a new color with the RGBA values specified
 
 Color (float r, float g, float b, float a)
 
 Color (uint32 c)
 create a new color with the ARGB values specified in a single unsigned 32 bit value
 
Coloroperator= (const Color &c)
 set this color equal to another
 
Coloroperator= (uint32 c)
 set to ARGB color value
 
bool operator== (const Color &c)
 check to see if this color is the same as another, IGNORES ALPHA
 
bool operator== (uint32 c)
 
void convertToGrayscale ()
 convert a color to a matching shade of grey
 

Static Public Member Functions

static Color makeColor (float rf, float gf, float bf)
 create a color from floating point RGB, values are 0.0 to 1.0
 
static Color makeColor (float rf, float gf, float bf, float af)
 create a color from floating point RGBA, values are 0.0 to 1.0
 
static Color makeColor (const char *cssColorValue)
 create a color from a CSS color string value, eg: "#111", "#237D1A", "black", etc...
 

Public Attributes

float red
 amount of red in the color, from 0.0 (none) to 1.0 (max red)
 
float green
 amount of green in the color, from 0.0 (none) to 1.0 (max green)
 
float blue
 amount of blue in the color, from 0.0 (none) to 1.0 (max blue)
 
float alpha
 the alpha value for the color
 

Detailed Description

A color in RGB color space, with optional alpha

Constructor & Destructor Documentation

Color ( )
inline

create a new black color object

Color ( int  r,
int  g,
int  b 
)
inline

create a new color with the RGB values specified

Color ( float  r,
float  g,
float  b 
)
inline
Color ( int  r,
int  g,
int  b,
int  a 
)
inline

create a new color with the RGBA values specified

Color ( float  r,
float  g,
float  b,
float  a 
)
inline
Color ( uint32  c)
inlineexplicit

create a new color with the ARGB values specified in a single unsigned 32 bit value

Member Function Documentation

void convertToGrayscale ( )
inline

convert a color to a matching shade of grey

static Color makeColor ( float  rf,
float  gf,
float  bf 
)
inlinestatic

create a color from floating point RGB, values are 0.0 to 1.0

static Color makeColor ( float  rf,
float  gf,
float  bf,
float  af 
)
inlinestatic

create a color from floating point RGBA, values are 0.0 to 1.0

static Color makeColor ( const char *  cssColorValue)
static

create a color from a CSS color string value, eg: "#111", "#237D1A", "black", etc...

Color& operator= ( const Color c)
inline

set this color equal to another

Color& operator= ( uint32  c)
inline

set to ARGB color value

bool operator== ( const Color c)
inline

check to see if this color is the same as another, IGNORES ALPHA

bool operator== ( uint32  c)
inline

Member Data Documentation

float alpha

the alpha value for the color

float blue

amount of blue in the color, from 0.0 (none) to 1.0 (max blue)

float green

amount of green in the color, from 0.0 (none) to 1.0 (max green)

float red

amount of red in the color, from 0.0 (none) to 1.0 (max red)