LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Color Class Reference

A light wrapper around SDL_Color. More...

#include <color.h>

Public Member Functions

 Color ()
 Construct the color with default (black) color.
 
 Color (int r, int g, int b)
 
void Set (int r, int g, int b)
 
SDL_Color Get () const
 Get the SDL_Color.
 
int R () const
 Get the red value.
 
void R (int r)
 Set the red value.
 
int G () const
 Get the green value.
 
void G (int g)
 Set the green value.
 
int B () const
 Get the blue value.
 
void B (int b)
 Set the blue value.
 
Json::Value Save () const
 
void Load (Json::Value val)
 
bool operator== (const Color &c) const
 Operator for comparing colors.
 
 operator std::string () const
 

Detailed Description

A light wrapper around SDL_Color.

A wrapper around the RGB SDL_Color to make it a bit nicer to use and make it easier to expose it to Lua via LuaBind

Constructor & Destructor Documentation

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

Construct the color with some desired color

Parameters
rThe red color value, 0-255
gThe green color value, 0-255
bThe blue color value, 0-255

Member Function Documentation

void Color::Load ( Json::Value  val)

Load the color data from a Json::Value

Parameters
valThe Json::Value to load from
Json::Value Color::Save ( ) const

Save the color data to a Json::Value

Returns
Json::Value containing information about the text
void Color::Set ( int  r,
int  g,
int  b 
)

Set the color to some RGB value

Parameters
rThe red color value, 0-255
gThe green color value, 0-255
bThe blue color value, 0-255

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