Biorithm  1.1
 All Classes Functions Variables Typedefs Friends
Public Member Functions | Static Public Member Functions | Public Attributes
Graphwhiz::MyColor Class Reference

List of all members.

Public Member Functions

 MyColor ()
 Default constructor.
 MyColor (unsigned int _R, unsigned int _G, unsigned int _B)
string printHTML () const
string printRGB () const

Static Public Member Functions

static MyColor generate (string id)

Public Attributes

unsigned int R
unsigned int G
unsigned int B
string RGB
string RGBHTML
string blank

Constructor & Destructor Documentation

Graphwhiz::MyColor::MyColor ( unsigned int  _R,
unsigned int  _G,
unsigned int  _B 
) [inline]

Constructor that takes a specific set of R, G, B values.

Note:
If any of the R, G, B values passed are greater than 255, the method thresholds them at 255.

Member Function Documentation

MyColor Graphwhiz::MyColor::generate ( string  id) [static]

Generate a colour for id.

The method creates a "hash" value (an integer) from id. To create the three components of the colour, the method takes the modulus of the id with three prime numbers close to 255.

Note:
g++-4.5 spews error messages when using first declaration, as hash<*>::hash refers to a constructor, not a type. However, previous versions of GCC (revision < 154519) would accept such declaration: see BUG-report+Changlog-in-response to this bug here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11764#c19 We don't know in which gcc version this have been fixed but found that g++-4.5.2 no longer accepts it, so conditionally build it:

The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Friends