Gosu::Color Class Reference

Represents an ARGB color value with 8 bits for each channel. More...

List of all members.

Public Types

typedef boost::uint8_t Channel

Public Member Functions

 Color ()
 Color (boost::uint32_t argb)
 Color (Channel red, Channel green, Channel blue)
 Color (Channel alpha, Channel red, Channel green, Channel blue)
Channel alpha () const
Channel red () const
Channel green () const
Channel blue () const
void setAlpha (Channel value)
void setRed (Channel value)
void setGreen (Channel value)
void setBlue (Channel value)
double hue () const
void setHue (double h)
double saturation () const
void setSaturation (double s)
double value () const
void setValue (double v)
boost::uint32_t argb () const
boost::uint32_t bgr () const
boost::uint32_t abgr () const

Static Public Member Functions

static Color fromHSV (double h, double s, double v)
static Color fromAHSV (Channel alpha, double h, double s, double v)


Detailed Description

Represents an ARGB color value with 8 bits for each channel.

Can be implicitly constructed from literals of the form 0xaarrggbb. Has fast value semantics.


Constructor & Destructor Documentation

Gosu::Color::Color (  )  [inline]

The default constructor does not initialize the color to any value.

Gosu::Color::Color ( boost::uint32_t  argb  )  [inline]

Conversion constructor for literals of the form 0xaarrggbb.

(C++ only.)


Member Function Documentation

static Color Gosu::Color::fromHSV ( double  h,
double  s,
double  v 
) [static]

Constructs a color from the given hue/saturation/value triple.

Ranges of these values are given as 0..360, 0..1 and 0..1, respectively. The alpha value is set to 1 from this method.

double Gosu::Color::hue (  )  const

Returns the hue of the color, in the usual range of 0..360.

void Gosu::Color::setHue ( double  h  ) 

Changes the current color so hue() will return h.

double Gosu::Color::saturation (  )  const

Returns the saturation of the color, in the range of 0..1.

void Gosu::Color::setSaturation ( double  s  ) 

Changes the current color so saturation() will return s.

double Gosu::Color::value (  )  const

Returns the value (brightness) of the color, in the range of 0..1.

void Gosu::Color::setValue ( double  v  ) 

Changes the current color so value() will return v.

boost::uint32_t Gosu::Color::argb (  )  const [inline]

Returns the color in 0xaarrggbb representation.

boost::uint32_t Gosu::Color::bgr (  )  const [inline]

Returns the color in 0x00bbggrr representation.

Referenced by abgr().

boost::uint32_t Gosu::Color::abgr (  )  const [inline]

Returns the color in 0xaabbggrr representation.

References bgr().


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

Generated on Fri Sep 12 21:50:23 2008 for Gosu by  doxygen 1.5.5