NanoCanvas
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
NanoCanvas::Color Struct Reference

#include <Color.hpp>

Public Member Functions

 Color ()
 
 Color (const unsigned int color)
 Construct a color with an unsigned integer value. More...
 
 Color (Byte _r, Byte _g, Byte _b, Byte _a=255)
 Construct color with it's components value in the range [0,255]. More...
 
 Color (int _r, int _g, int _b, int _a=255)
 Construct color with it's components value in the range [0,255]. More...
 
 Color (unsigned _r, unsigned _g, unsigned _b, unsigned _a=255)
 Construct color with it's components value in the range [0,255]. More...
 
 Color (float _r, float _g, float _b, float _a=1.0f)
 Construct color with it's components value in the range [0,1]. More...
 
 operator unsigned int () const
 Convert the color to unsigned int as the color code. More...
 
Byteoperator[] (int index)
 
const Byte operator[] (int index) const
 
bool operator== (const Color &color)
 
bool operator< (const Color &color)
 
Coloroperator= (const unsigned int color)
 
Coloroperator+= (const Color &color)
 
Coloroperator-= (const Color &color)
 
Coloroperator*= (const Color &color)
 
Color operator+ (const Color &color)
 
Color operator- (const Color &color)
 
Color operator* (const Color &color)
 
Colorset (unsigned int color)
 
Colorset (float _r, float _g, float _b, float _a)
 
Colorset (Byte _r, Byte _g, Byte _b, Byte _a)
 
Colorset (unsigned _r, unsigned _g, unsigned _b, unsigned _a)
 
Colorset (int _r, int _g, int _b, int _a)
 
unsigned int code () const
 
float redf () const
 
float greenf () const
 
float bluef () const
 
float alphaf () const
 

Static Public Member Functions

static Color createWidthHSL (float _h, float _s, float _l, float _a=1.0f)
 

Public Attributes

union {
   struct {
      Byte   r
 Red value. More...
 
      Byte   g
 Green value. More...
 
      Byte   b
 Blue value. More...
 
      Byte   a
 Alpha value. More...
 
   } 
 
   Byte   mem [4]
 
}; 
 

Constructor & Destructor Documentation

NanoCanvas::Color::Color ( )
inline
NanoCanvas::Color::Color ( const unsigned int  color)
inline

Construct a color with an unsigned integer value.

Parameters
colorThe color code value
NanoCanvas::Color::Color ( Byte  _r,
Byte  _g,
Byte  _b,
Byte  _a = 255 
)
inline

Construct color with it's components value in the range [0,255].

Parameters
_rThe red component value
_gThe green component value
_bThe blue component value
_aThe alpha component value
NanoCanvas::Color::Color ( int  _r,
int  _g,
int  _b,
int  _a = 255 
)
inline

Construct color with it's components value in the range [0,255].

Parameters
_rThe red component value
_gThe green component value
_bThe blue component value
_aThe alpha component value
NanoCanvas::Color::Color ( unsigned  _r,
unsigned  _g,
unsigned  _b,
unsigned  _a = 255 
)
inline

Construct color with it's components value in the range [0,255].

Parameters
_rThe red component value
_gThe green component value
_bThe blue component value
_aThe alpha component value
NanoCanvas::Color::Color ( float  _r,
float  _g,
float  _b,
float  _a = 1.0f 
)
inline

Construct color with it's components value in the range [0,1].

Parameters
_rThe red component value
_gThe green component value
_bThe blue component value
_aThe alpha component value

Member Function Documentation

float NanoCanvas::Color::alphaf ( ) const
inline
float NanoCanvas::Color::bluef ( ) const
inline
unsigned int NanoCanvas::Color::code ( ) const
inline
static Color NanoCanvas::Color::createWidthHSL ( float  _h,
float  _s,
float  _l,
float  _a = 1.0f 
)
inlinestatic
float NanoCanvas::Color::greenf ( ) const
inline
NanoCanvas::Color::operator unsigned int ( ) const
inline

Convert the color to unsigned int as the color code.

Color NanoCanvas::Color::operator* ( const Color color)
inline
Color& NanoCanvas::Color::operator*= ( const Color color)
inline
Color NanoCanvas::Color::operator+ ( const Color color)
inline
Color& NanoCanvas::Color::operator+= ( const Color color)
inline
Color NanoCanvas::Color::operator- ( const Color color)
inline
Color& NanoCanvas::Color::operator-= ( const Color color)
inline
bool NanoCanvas::Color::operator< ( const Color color)
inline
Color& NanoCanvas::Color::operator= ( const unsigned int  color)
inline
bool NanoCanvas::Color::operator== ( const Color color)
inline
Byte& NanoCanvas::Color::operator[] ( int  index)
inline
const Byte NanoCanvas::Color::operator[] ( int  index) const
inline
float NanoCanvas::Color::redf ( ) const
inline
Color& NanoCanvas::Color::set ( unsigned int  color)
inline
Color& NanoCanvas::Color::set ( float  _r,
float  _g,
float  _b,
float  _a 
)
inline
Color& NanoCanvas::Color::set ( Byte  _r,
Byte  _g,
Byte  _b,
Byte  _a 
)
inline
Color& NanoCanvas::Color::set ( unsigned  _r,
unsigned  _g,
unsigned  _b,
unsigned  _a 
)
inline
Color& NanoCanvas::Color::set ( int  _r,
int  _g,
int  _b,
int  _a 
)
inline

Member Data Documentation

union { ... }
Byte NanoCanvas::Color::a

Alpha value.

Byte NanoCanvas::Color::b

Blue value.

Byte NanoCanvas::Color::g

Green value.

Byte NanoCanvas::Color::mem[4]
Byte NanoCanvas::Color::r

Red value.


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

The documentation was generated by Doxygen

Copyright © 2015 Geequlim. All rights reserved.