Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Public Attributes | Static Public Attributes
render::Color Class Reference

Class representing color. More...

#include <Color.h>

List of all members.

Public Member Functions

 Color (f32 red=1.0f, f32 green=1.0f, f32 blue=1.0f, f32 alpha=1.0f)
 Color (const Color &other)
f32get ()
const f32get () const
u32 getAsABGR () const
 Retrieves colors as ABGR.
u32 getAsARGB () const
 Retrieves color as ARGB.
u32 getAsBGRA () const
 Retrieves color as BGRA.
u32 getAsRGBA () const
 Retrieves color as RGBA.
bool operator!= (const Color &other) const
Color operator* (const Color &other) const
Color operator* (const f32 v) const
Coloroperator*= (const f32 v)
Color operator+ (const Color &other) const
Coloroperator+= (const Color &other)
Color operator- (const Color &other) const
Coloroperator-= (const Color &other)
Color operator/ (const f32 v) const
Color operator/ (const Color &other) const
Coloroperator/= (const f32 v)
Coloroperator= (const Color &other)
bool operator== (const Color &other) const
void setAsABGR (const u32 val)
 Sets color as ABGR.
void setAsARGB (const u32 val)
 Sets color as ARGB.
void setAsBGRA (const u32 val)
 Sets color as BGRA.
void setAsRGBA (const u32 val)
 Sets color as RGBA.
void setHSB (f32 hue, f32 saturation, f32 brightness)

Public Attributes

f32 A
f32 B
f32 G
f32 R

Static Public Attributes

static const Color Black = Color(0.0, 0.0, 0.0)
static const Color Blue = Color(0.0, 0.0, 1.0)
static const Color Green = Color(0.0, 1.0, 0.0)
static const Color Red = Color(1.0, 0.0, 0.0)
static const Color White = Color(1.0, 1.0, 1.0)
static const Color ZERO = Color(0.0, 0.0, 0.0, 0.0)

Detailed Description

Class representing color.

Color is represented as 4 components, each of which is a floating-point value from 0.0 to 1.0.

:
The 3 'normal' color components are red, green and blue, a higher number indicating greater amounts of that component in the color. The forth component is the 'alpha' value, which represents transparency. In this case, 0.0 is completely transparent and 1.0 is fully opaque.

Constructor & Destructor Documentation

render::Color::Color ( f32  red = 1.0f,
f32  green = 1.0f,
f32  blue = 1.0f,
f32  alpha = 1.0f 
)
render::Color::Color ( const Color other)

Member Function Documentation

f32 * render::Color::get ( )

References R.

Referenced by render::Shader::setParamerter().

const f32 * render::Color::get ( ) const

References R.

u32 render::Color::getAsABGR ( ) const

Retrieves colors as ABGR.

u32 render::Color::getAsARGB ( ) const

Retrieves color as ARGB.

u32 render::Color::getAsBGRA ( ) const

Retrieves color as BGRA.

u32 render::Color::getAsRGBA ( ) const

Retrieves color as RGBA.

bool render::Color::operator!= ( const Color other) const [inline]
Color render::Color::operator* ( const f32  v) const [inline]

References A, B, Color(), G, and R.

Color render::Color::operator* ( const Color other) const [inline]

References A, B, Color(), G, and R.

Color & render::Color::operator*= ( const f32  v) [inline]

References A, B, G, and R.

Color render::Color::operator+ ( const Color other) const [inline]

References A, B, Color(), G, and R.

Color & render::Color::operator+= ( const Color other) [inline]

References A, B, G, and R.

Color render::Color::operator- ( const Color other) const [inline]

References A, B, Color(), G, and R.

Color & render::Color::operator-= ( const Color other) [inline]

References A, B, G, and R.

Color render::Color::operator/ ( const Color other) const [inline]

References A, B, Color(), G, and R.

Color render::Color::operator/ ( const f32  v) const [inline]

References A, B, Color(), G, and R.

Color & render::Color::operator/= ( const f32  v) [inline]

References A, B, G, and R.

Color & render::Color::operator= ( const Color other) [inline]

References A, B, G, and R.

bool render::Color::operator== ( const Color other) const [inline]

References A, B, G, and R.

void render::Color::setAsABGR ( const u32  val)

Sets color as ABGR.

void render::Color::setAsARGB ( const u32  val)

Sets color as ARGB.

void render::Color::setAsBGRA ( const u32  val)

Sets color as BGRA.

void render::Color::setAsRGBA ( const u32  val)

Sets color as RGBA.

void render::Color::setHSB ( f32  hue,
f32  saturation,
f32  brightness 
)

Set a color value from Hue, Saturation and Brightness.

Parameters:
hue,:Hue value, scaled to the [0,1] range as opposed to the 0-360
saturation,:Saturation level, [0,1]
brightness,:Brightness level, [0,1]

Member Data Documentation

const Color render::Color::Black = Color(0.0, 0.0, 0.0) [static]
const Color render::Color::Blue = Color(0.0, 0.0, 1.0) [static]

Referenced by resource::parseColor().

const Color render::Color::Green = Color(0.0, 1.0, 0.0) [static]

Referenced by resource::parseColor().

const Color render::Color::Red = Color(1.0, 0.0, 0.0) [static]

Referenced by resource::parseColor().

const Color render::Color::White = Color(1.0, 1.0, 1.0) [static]
const Color render::Color::ZERO = Color(0.0, 0.0, 0.0, 0.0) [static]

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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:08 by Doxygen (1.7.4)