Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_Color Class Reference
[UI]

General class to represent a color. More...

Inheritance diagram for CP_Color:

CP_NoCopy List of all members.

Named colors

CP_String GetString () const
bool SetString (const CP_String &inColor)
CP_String GetName () const
static CP_Color GetColor (const CP_String &inColor)
static CP_Color GetColor (SInt16 inindex)
static CP_String GetName (SInt16 inindex)
static SInt16 GetCount ()

Public Types

enum  CP_E_NAMED_CP_COLOR {
  cp_none = 0x7FFFFFFF, cp_aliceblue = 0x00FFF8F0, cp_antiquewhite = 0x00D7EBFA, cp_aqua = 0x00FFFF00,
  cp_aquamarine = 0x00D4FF7F, cp_azure = 0x00FFFFF0, cp_beige = 0x00DCF5F5, cp_bisque = 0x00C4E4FF,
  cp_black = 0x00000000, cp_blanchedalmond = 0x00CDEBFF, cp_blue = 0x00FF0000, cp_blueviolet = 0x00E22B8A,
  cp_brown = 0x002A2AA5, cp_burlywood = 0x0087B8DE, cp_cadetblue = 0x00A09E5F, cp_chartreuse = 0x0000FF7F,
  cp_chocolate = 0x001E69D2, cp_coral = 0x00507FFF, cp_cornflower = 0x00ED9564, cp_cornsilk = 0x00DCF8FF,
  cp_crimson = 0x003C14DC, cp_cyan = 0x00FFFF00, cp_darkblue = 0x008B0000, cp_darkcyan = 0x008B8B00,
  cp_darkgoldenrod = 0x000B86B8, cp_darkgray = 0x00A9A9A9, cp_darkgreen = 0x00006400, cp_darkkhaki = 0x006BB7BD,
  cp_darkmagenta = 0x008B008B, cp_darkolivegreen = 0x002F6B55, cp_darkorange = 0x00008CFF, cp_darkorchid = 0x00CC3299,
  cp_darkred = 0x0000008B, cp_darksalmon = 0x007A96E9, cp_darkseagreen = 0x008BBC8F, cp_darkslateblue = 0x008B3D48,
  cp_darkslategray = 0x004F4F2F, cp_darkturquoise = 0x00D1CE00, cp_darkviolet = 0x00D30094, cp_deeppink = 0x009314FF,
  cp_deepskyblue = 0x00FFBF00, cp_dimgray = 0x00696969, cp_dodgerblue = 0x00FF901E, cp_firebrick = 0x002222B2,
  cp_floralwhite = 0x00F0FAFF, cp_forestgreen = 0x00228B22, cp_fuchsia = 0x00FF00FF, cp_gainsboro = 0x00DCDCDC,
  cp_ghostwhite = 0x00FFF8F8, cp_gold = 0x0000D7FF, cp_goldenrod = 0x0020A5DA, cp_gray = 0x00808080,
  cp_green = 0x00008000, cp_greenyellow = 0x002FFFAD, cp_honeydew = 0x00F0FFF0, cp_hotpink = 0x00B469FF,
  cp_indianred = 0x005C5CCD, cp_indigo = 0x0082004B, cp_ivory = 0x00F0FFFF, cp_khaki = 0x008CE6F0,
  cp_lavender = 0x00FAE6E6, cp_lavenderblush = 0x00F5F0FF, cp_lawngreen = 0x0000FC7C, cp_lemonchiffon = 0x00CDFAFF,
  cp_lightblue = 0x00E6D8AD, cp_lightcoral = 0x008080F0, cp_lightcyan = 0x00FFFFE0, cp_lightgoldenrodyellow = 0x00D2FAFA,
  cp_lightgreen = 0x0090EE90, cp_lightgrey = 0x00D3D3D3, cp_lightpink = 0x00C1B6FF, cp_lightsalmon = 0x007AA0FF,
  cp_lightseagreen = 0x00AAB220, cp_lightskyblue = 0x00FACE87, cp_lightslategray = 0x00998877, cp_lightsteelblue = 0x00DEC4B0,
  cp_lightyellow = 0x00E0FFFF, cp_lime = 0x0000FF00, cp_limegreen = 0x0032CD32, cp_linen = 0x00E6F0FA,
  cp_magenta = 0x00FF00FF, cp_maroon = 0x00000080, cp_mediumaquamarine = 0x00AACD66, cp_mediumblue = 0x00CD0000,
  cp_mediumorchid = 0x00D355BA, cp_mediumpurple = 0x00DB7093, cp_mediumseagreen = 0x0071B33C, cp_mediumslateblue = 0x00EE687B,
  cp_mediumspringgreen = 0x009AFA00, cp_mediumturquoise = 0x00CCD148, cp_mediumvioletred = 0x008515C7, cp_midnightblue = 0x00701919,
  cp_mintcream = 0x00FAFFF5, cp_mistyrose = 0x00E1E4FF, cp_moccasin = 0x00B5E4FF, cp_navajowhite = 0x00ADDEFF,
  cp_navy = 0x00800000, cp_oldlace = 0x00E6F5FD, cp_olive = 0x00008080, cp_olivedrab = 0x00238E6B,
  cp_orange = 0x0000A5FF, cp_orangered = 0x000045FF, cp_orchid = 0x00D670DA, cp_palegoldenrod = 0x00AAE8EE,
  cp_palegreen = 0x0098FB98, cp_paleturquoise = 0x00EEEEAF, cp_palevioletred = 0x009370DB, cp_papayawhip = 0x00D5EFFF,
  cp_peachpuff = 0x00B9DAFF, cp_peru = 0x003F85CD, cp_pink = 0x00CBC0FF, cp_plum = 0x00DDA0DD,
  cp_powderblue = 0x00E6E0B0, cp_purple = 0x00800080, cp_red = 0x000000FF, cp_rosybrown = 0x008F8FBC,
  cp_royalblue = 0x00E16941, cp_saddlebrown = 0x0013458B, cp_salmon = 0x007280FA, cp_sandybrown = 0x0060A4F4,
  cp_seagreen = 0x00578B2E, cp_seashell = 0x00EEF5FF, cp_sienna = 0x002D52A0, cp_silver = 0x00C0C0C0,
  cp_skyblue = 0x00EBCE87, cp_slateblue = 0x00CD5A6A, cp_slategray = 0x00908070, cp_snow = 0x00FAFAFF,
  cp_springgreen = 0x007FFF00, cp_steelblue = 0x00B48246, cp_tan = 0x008CB4D2, cp_teal = 0x00808000,
  cp_thistle = 0x00D8BFD8, cp_tomato = 0x004763FF, cp_turquoise = 0x00D0E040, cp_violet = 0x00EE82EE,
  cp_wheat = 0x00B3DEF5, cp_white = 0x00FFFFFF, cp_whitesmoke = 0x00F5F5F5, cp_yellow = 0x0000FFFF,
  cp_yellowgreen = 0x0032CD9A, cp_gray_1 = 0x00EEEEEE, cp_gray_2 = 0x00DDDDDD, cp_gray_3 = 0x00CCCCCC,
  cp_gray_4 = 0x00BBBBBB, cp_gray_5 = 0x00AAAAAA, cp_gray_6 = 0x00999999, cp_gray_7 = 0x00888888,
  cp_gray_8 = 0x00777777, cp_gray_9 = 0x00666666, cp_gray_10 = 0x00555555, cp_gray_11 = 0x00444444,
  cp_gray_12 = 0x00222222
}
enum  CP_E_NAMED_CP_COLOR_INDEX {
  INDEX_aliceblue = 1, INDEX_antiquewhite, INDEX_aqua, INDEX_aquamarine,
  INDEX_azure, INDEX_beige, INDEX_bisque, INDEX_black,
  INDEX_blanchedalmond, INDEX_blue, INDEX_blueviolet, INDEX_brown,
  INDEX_burlywood, INDEX_cadetblue, INDEX_chartreuse, INDEX_chocolate,
  INDEX_coral, INDEX_cornflower, INDEX_cornsilk, INDEX_crimson,
  INDEX_cyan, INDEX_darkblue, INDEX_darkcyan, INDEX_darkgoldenrod,
  INDEX_darkgray, INDEX_darkgreen, INDEX_darkkhaki, INDEX_darkmagenta,
  INDEX_darkolivegreen, INDEX_darkorange, INDEX_darkorchid, INDEX_darkred,
  INDEX_darksalmon, INDEX_darkseagreen, INDEX_darkslateblue, INDEX_darkslategray,
  INDEX_darkturquoise, INDEX_darkviolet, INDEX_deeppink, INDEX_deepskyblue,
  INDEX_dimgray, INDEX_dodgerblue, INDEX_firebrick, INDEX_floralwhite,
  INDEX_forestgreen, INDEX_fuchsia, INDEX_gainsboro, INDEX_ghostwhite,
  INDEX_gold, INDEX_goldenrod, INDEX_gray, INDEX_green,
  INDEX_greenyellow, INDEX_honeydew, INDEX_hotpink, INDEX_indianred,
  INDEX_indigo, INDEX_ivory, INDEX_khaki, INDEX_lavender,
  INDEX_lavenderblush, INDEX_lawngreen, INDEX_lemonchiffon, INDEX_lightblue,
  INDEX_lightcoral, INDEX_lightcyan, INDEX_lightgoldenrodyellow, INDEX_lightgreen,
  INDEX_lightgrey, INDEX_lightpink, INDEX_lightsalmon, INDEX_lightseagreen,
  INDEX_lightskyblue, INDEX_lightslategray, INDEX_lightsteelblue, INDEX_lightyellow,
  INDEX_lime, INDEX_limegreen, INDEX_linen, INDEX_magenta,
  INDEX_maroon, INDEX_mediumaquamarine, INDEX_mediumblue, INDEX_mediumorchid,
  INDEX_mediumpurple, INDEX_mediumseagreen, INDEX_mediumslateblue, INDEX_mediumspringgreen,
  INDEX_mediumturquoise, INDEX_mediumvioletred, INDEX_midnightblue, INDEX_mintcream,
  INDEX_mistyrose, INDEX_moccasin, INDEX_navajowhite, INDEX_navy,
  INDEX_oldlace, INDEX_olive, INDEX_olivedrab, INDEX_orange,
  INDEX_orangered, INDEX_orchid, INDEX_palegoldenrod, INDEX_palegreen,
  INDEX_paleturquoise, INDEX_palevioletred, INDEX_papayawhip, INDEX_peachpuff,
  INDEX_peru, INDEX_pink, INDEX_plum, INDEX_powderblue,
  INDEX_purple, INDEX_red, INDEX_rosybrown, INDEX_royalblue,
  INDEX_saddlebrown, INDEX_salmon, INDEX_sandybrown, INDEX_seagreen,
  INDEX_seashell, INDEX_sienna, INDEX_silver, INDEX_skyblue,
  INDEX_slateblue, INDEX_slategray, INDEX_snow, INDEX_springgreen,
  INDEX_steelblue, INDEX_tan, INDEX_teal, INDEX_thistle,
  INDEX_tomato, INDEX_turquoise, INDEX_violet, INDEX_wheat,
  INDEX_white, INDEX_whitesmoke, INDEX_yellow, INDEX_yellowgreen,
  INDEX_gray_1, INDEX_gray_2, INDEX_gray_3, INDEX_gray_4,
  INDEX_gray_5, INDEX_gray_6, INDEX_gray_7, INDEX_gray_8,
  INDEX_gray_9, INDEX_gray_10, INDEX_gray_11, INDEX_gray_12,
  numNamedColors
}

Public Member Functions

virtual ~CP_Color ()
 Destructor.
Constructor / Destructor
 CP_Color ()
 Constructor.
 CP_Color (UInt16 inRed, UInt16 inGreen, UInt16 inBlue)
 CP_Color (const CP_Color &inColor)
 CP_Color (UInt32 inColorRef)
Getters
UInt16 Red () const
UInt16 Green () const
UInt16 Blue () const
float Hue () const
float Luminance () const
float Saturation () const
CP_RGBColor GetRGBColor ()
CP_ARGBColor GetARGBColor ()
operators
bool operator== (const CP_Color &inColor) const
bool operator!= (const CP_Color &inColor) const
CP_Coloroperator= (const CP_Color &inColor)
Setters
void Set (UInt16 inRed, UInt16 inGreen, UInt16 inBlue)
void Set (const CP_Color &inColor)
void SetHue (float inHue)
void SetLuminance (float inLuminance)
void SetSaturation (float inSaturation)
void SetHLS (float inHue, float inLuminance, float inSaturation)
Constructor / Destructor
 CP_Color (RGBColor inColor)
 Constructor.
operators
 operator RGBColor * ()
 operator const RGBColor * () const
 operator RGBColor ()
 operator const RGBColor () const
Setters
void Set (const RGBColor inColor)
operators
COLORREF GetCOLORREF () const
 operator COLORREF () const
Setters
void Set (COLORREF inColor)
Getters
GdkColor * GetGDKColor ()

Protected Attributes

UInt16 fRed
UInt16 fGreen
UInt16 fBlue
float fHue
float fSaturation
float fLuminance
bool fIsRGB
bool fIsHLS
UInt32 fColorRef
GdkColor * fGDKColor

Static Protected Attributes

static const CP_S_NamedColor fNamedColors [numNamedColors]

Private Member Functions

Getters
void ToHLS ()
void ToRGB ()
unsigned char ToRGB (float rm1, float rm2, float rh)

Classes

struct  CP_S_NamedColor

Detailed Description

This class is used to maintain a list of colors that can be accessed by name, or index into the table.

Support for setting and getting the HLS values of the color, and setting and getting the color as a CP_RGBColor are also implemented.


Member Enumeration Documentation

enum CP_Color::CP_E_NAMED_CP_COLOR
 

Enumeration values:
cp_none 
cp_aliceblue 
cp_antiquewhite 
cp_aqua 
cp_aquamarine 
cp_azure 
cp_beige 
cp_bisque 
cp_black 
cp_blanchedalmond 
cp_blue 
cp_blueviolet 
cp_brown 
cp_burlywood 
cp_cadetblue 
cp_chartreuse 
cp_chocolate 
cp_coral 
cp_cornflower 
cp_cornsilk 
cp_crimson 
cp_cyan 
cp_darkblue 
cp_darkcyan 
cp_darkgoldenrod 
cp_darkgray 
cp_darkgreen 
cp_darkkhaki 
cp_darkmagenta 
cp_darkolivegreen 
cp_darkorange 
cp_darkorchid 
cp_darkred 
cp_darksalmon 
cp_darkseagreen 
cp_darkslateblue 
cp_darkslategray 
cp_darkturquoise 
cp_darkviolet 
cp_deeppink 
cp_deepskyblue 
cp_dimgray 
cp_dodgerblue 
cp_firebrick 
cp_floralwhite 
cp_forestgreen 
cp_fuchsia 
cp_gainsboro 
cp_ghostwhite 
cp_gold 
cp_goldenrod 
cp_gray 
cp_green 
cp_greenyellow 
cp_honeydew 
cp_hotpink 
cp_indianred 
cp_indigo 
cp_ivory 
cp_khaki 
cp_lavender 
cp_lavenderblush 
cp_lawngreen 
cp_lemonchiffon 
cp_lightblue 
cp_lightcoral 
cp_lightcyan 
cp_lightgoldenrodyellow 
cp_lightgreen 
cp_lightgrey 
cp_lightpink 
cp_lightsalmon 
cp_lightseagreen 
cp_lightskyblue 
cp_lightslategray 
cp_lightsteelblue 
cp_lightyellow 
cp_lime 
cp_limegreen 
cp_linen 
cp_magenta 
cp_maroon 
cp_mediumaquamarine 
cp_mediumblue 
cp_mediumorchid 
cp_mediumpurple 
cp_mediumseagreen 
cp_mediumslateblue 
cp_mediumspringgreen 
cp_mediumturquoise 
cp_mediumvioletred 
cp_midnightblue 
cp_mintcream 
cp_mistyrose 
cp_moccasin 
cp_navajowhite 
cp_navy 
cp_oldlace 
cp_olive 
cp_olivedrab 
cp_orange 
cp_orangered 
cp_orchid 
cp_palegoldenrod 
cp_palegreen 
cp_paleturquoise 
cp_palevioletred 
cp_papayawhip 
cp_peachpuff 
cp_peru 
cp_pink 
cp_plum 
cp_powderblue 
cp_purple 
cp_red 
cp_rosybrown 
cp_royalblue 
cp_saddlebrown 
cp_salmon 
cp_sandybrown 
cp_seagreen 
cp_seashell 
cp_sienna 
cp_silver 
cp_skyblue 
cp_slateblue 
cp_slategray 
cp_snow 
cp_springgreen 
cp_steelblue 
cp_tan 
cp_teal 
cp_thistle 
cp_tomato 
cp_turquoise 
cp_violet 
cp_wheat 
cp_white 
cp_whitesmoke 
cp_yellow 
cp_yellowgreen 
cp_gray_1 
cp_gray_2 
cp_gray_3 
cp_gray_4 
cp_gray_5 
cp_gray_6 
cp_gray_7 
cp_gray_8 
cp_gray_9 
cp_gray_10 
cp_gray_11 
cp_gray_12 

enum CP_Color::CP_E_NAMED_CP_COLOR_INDEX
 

Enumeration values:
INDEX_aliceblue 
INDEX_antiquewhite 
INDEX_aqua 
INDEX_aquamarine 
INDEX_azure 
INDEX_beige 
INDEX_bisque 
INDEX_black 
INDEX_blanchedalmond 
INDEX_blue 
INDEX_blueviolet 
INDEX_brown 
INDEX_burlywood 
INDEX_cadetblue 
INDEX_chartreuse 
INDEX_chocolate 
INDEX_coral 
INDEX_cornflower 
INDEX_cornsilk 
INDEX_crimson 
INDEX_cyan 
INDEX_darkblue 
INDEX_darkcyan 
INDEX_darkgoldenrod 
INDEX_darkgray 
INDEX_darkgreen 
INDEX_darkkhaki 
INDEX_darkmagenta 
INDEX_darkolivegreen 
INDEX_darkorange 
INDEX_darkorchid 
INDEX_darkred 
INDEX_darksalmon 
INDEX_darkseagreen 
INDEX_darkslateblue 
INDEX_darkslategray 
INDEX_darkturquoise 
INDEX_darkviolet 
INDEX_deeppink 
INDEX_deepskyblue 
INDEX_dimgray 
INDEX_dodgerblue 
INDEX_firebrick 
INDEX_floralwhite 
INDEX_forestgreen 
INDEX_fuchsia 
INDEX_gainsboro 
INDEX_ghostwhite 
INDEX_gold 
INDEX_goldenrod 
INDEX_gray 
INDEX_green 
INDEX_greenyellow 
INDEX_honeydew 
INDEX_hotpink 
INDEX_indianred 
INDEX_indigo 
INDEX_ivory 
INDEX_khaki 
INDEX_lavender 
INDEX_lavenderblush 
INDEX_lawngreen 
INDEX_lemonchiffon 
INDEX_lightblue 
INDEX_lightcoral 
INDEX_lightcyan 
INDEX_lightgoldenrodyellow 
INDEX_lightgreen 
INDEX_lightgrey 
INDEX_lightpink 
INDEX_lightsalmon 
INDEX_lightseagreen 
INDEX_lightskyblue 
INDEX_lightslategray 
INDEX_lightsteelblue 
INDEX_lightyellow 
INDEX_lime 
INDEX_limegreen 
INDEX_linen 
INDEX_magenta 
INDEX_maroon 
INDEX_mediumaquamarine 
INDEX_mediumblue 
INDEX_mediumorchid 
INDEX_mediumpurple 
INDEX_mediumseagreen 
INDEX_mediumslateblue 
INDEX_mediumspringgreen 
INDEX_mediumturquoise 
INDEX_mediumvioletred 
INDEX_midnightblue 
INDEX_mintcream 
INDEX_mistyrose 
INDEX_moccasin 
INDEX_navajowhite 
INDEX_navy 
INDEX_oldlace 
INDEX_olive 
INDEX_olivedrab 
INDEX_orange 
INDEX_orangered 
INDEX_orchid 
INDEX_palegoldenrod 
INDEX_palegreen 
INDEX_paleturquoise 
INDEX_palevioletred 
INDEX_papayawhip 
INDEX_peachpuff 
INDEX_peru 
INDEX_pink 
INDEX_plum 
INDEX_powderblue 
INDEX_purple 
INDEX_red 
INDEX_rosybrown 
INDEX_royalblue 
INDEX_saddlebrown 
INDEX_salmon 
INDEX_sandybrown 
INDEX_seagreen 
INDEX_seashell 
INDEX_sienna 
INDEX_silver 
INDEX_skyblue 
INDEX_slateblue 
INDEX_slategray 
INDEX_snow 
INDEX_springgreen 
INDEX_steelblue 
INDEX_tan 
INDEX_teal 
INDEX_thistle 
INDEX_tomato 
INDEX_turquoise 
INDEX_violet 
INDEX_wheat 
INDEX_white 
INDEX_whitesmoke 
INDEX_yellow 
INDEX_yellowgreen 
INDEX_gray_1 
INDEX_gray_2 
INDEX_gray_3 
INDEX_gray_4 
INDEX_gray_5 
INDEX_gray_6 
INDEX_gray_7 
INDEX_gray_8 
INDEX_gray_9 
INDEX_gray_10 
INDEX_gray_11 
INDEX_gray_12 
numNamedColors 


Constructor & Destructor Documentation

CP_Color::CP_Color  ) 
 

Constructor. The color will be set to black as the default.

Exceptions:
none 

CP_Color::CP_Color UInt16  inRed,
UInt16  inGreen,
UInt16  inBlue
 

Constructor.

Parameters:
inRed Red component of the color.
inGreen Green component of the color.
inBlue Blue component of the color.
Exceptions:
none 

CP_Color::CP_Color const CP_Color inColor  ) 
 

Copy constructor.

Parameters:
inColor The color to copy the fields from.
Exceptions:
none 

CP_Color::CP_Color UInt32  inColorRef  ) 
 

Constructor.

Parameters:
inColorRef An unsigned long that contains the 3 components of the color.
Exceptions:
none 

CP_Color::~CP_Color  )  [virtual]
 

Destructor.

Exceptions:
none 

CP_Color::CP_Color RGBColor  inColor  ) 
 

The Gdk reprentation of a color.


Member Function Documentation

UInt16 CP_Color::Red  )  const
 

Returns the red component.

Exceptions:
none 
Returns:
UInt16 const The red component of the color.

UInt16 CP_Color::Green  )  const
 

Returns the green component.

Exceptions:
none 
Returns:
UInt16 const The green component of the color.

UInt16 CP_Color::Blue  )  const
 

Returns the blue component.

Exceptions:
none 
Returns:
UInt16 const The blue component of the color.

float CP_Color::Hue  )  const
 

Returns the hue of the color.

Exceptions:
none 
Returns:
float const The hue of the color.

float CP_Color::Luminance  )  const
 

Returns the luminance of the color.

Exceptions:
none 
Returns:
float const The luminance of the color.

float CP_Color::Saturation  )  const
 

Returns the saturation of the color.

Exceptions:
none 
Returns:
float const The saturation of the color.

CP_RGBColor CP_Color::GetRGBColor  ) 
 

Returns this color representation as a CP_RGBColor object.

Exceptions:
none 
Returns:
CP_RGBColor The color as a CP_RGBColor.

CP_ARGBColor CP_Color::GetARGBColor  ) 
 

Returns this color representation as a CP_ARGBColor object.

Exceptions:
none 
Returns:
CP_ARGBColor The color as a CP_ARGBColor.

CP_String CP_Color::GetString  )  const
 

Returns a CP_String containing the color formatted as 6 hex digits, as RRGGBB.

Exceptions:
none 
Returns:
CP_String A CP_String of this color.

bool CP_Color::SetString const CP_String inColor  ) 
 

Sets the color from the passed in string in the form RRGGBB.

Parameters:
inColor String representing the color to set.
Exceptions:
none 
Returns:
bool Returns true if the passed in string contained data in the form expected. Otherwise false is returned.

CP_String CP_Color::GetName  )  const
 

Returns the name of this color as a CP_String.

Exceptions:
none 
Returns:
CP_String const The name of this color.

CP_Color CP_Color::GetColor const CP_String inColor  )  [static]
 

Returns a CP_Color object corresponding to the passed in named color.

Parameters:
inColor CP_String containing the name of the color desired.
Exceptions:
none 
Returns:
CP_Color A CP_Color for the desired color.

CP_Color CP_Color::GetColor SInt16  inIndex  )  [static]
 

Gets a CP_Color object of the color stored at inIndex in the table of colors we know about.

Parameters:
inIndex Index in the table of colors to return.
Exceptions:
none 
Returns:
CP_Color const A CP_Color for the desired color.

CP_String CP_Color::GetName SInt16  inIndex  )  [static]
 

Returns the name of the color from the passed in inIndex.

Parameters:
inIndex 1 based index of the color to return the name of.
Exceptions:
none 
Returns:
CP_String const The name of the color.

static SInt16 CP_Color::GetCount  )  [static]
 

Returns the number of colors we know the names of.

Exceptions:
none 
Returns:
SInt16 The number of colors in the table.

bool CP_Color::operator== const CP_Color inColor  )  const
 

Equality operator.

Parameters:
inColor The color to test for equality with.
Exceptions:
none 
Returns:
bool Returns true if this color represents the same color as the passed in color.

bool CP_Color::operator!= const CP_Color inColor  )  const
 

Inequality operator.

Parameters:
inColor The color to test for equality with.
Exceptions:
none 
Returns:
bool Returns true if this color does not represent the same color as the passed in color.

CP_Color & CP_Color::operator= const CP_Color inColor  ) 
 

Assignment operator.

Parameters:
inColor The color to assign the fields from.
Exceptions:
none 
Returns:
CP_Color& Returns a reference to this object.

void CP_Color::Set UInt16  inRed,
UInt16  inGreen,
UInt16  inBlue
 

Sets the color components from the 3 passed in UInts.

Parameters:
inRed The red component.
inGreen The green component.
inBlue The blue component.
Exceptions:
none 
Returns:
void

void CP_Color::Set const CP_Color inColor  ) 
 

Sets the color from the passed in CP_Color object.

Parameters:
inColor CP_Color object to copy information from.
Exceptions:
none 
Returns:
void

void CP_Color::SetHue float  inHue  ) 
 

Sets the hue value of this color.

Parameters:
inHue The hue for this color.
Exceptions:
none 
Returns:
void

void CP_Color::SetLuminance float  inLuminance  ) 
 

Sets the luminance value of this color.

Parameters:
inLuminance The luminance for this color.
Exceptions:
none 
Returns:
void

void CP_Color::SetSaturation float  inSaturation  ) 
 

Sets the saturation value of this color.

Parameters:
inSaturation The saturation for this color.
Exceptions:
none 
Returns:
void

void CP_Color::SetHLS float  inHue,
float  inLuminance,
float  inSaturation
 

Sets the hue, luminance and saturation values for this color.

Parameters:
inHue The hue for this color.
inLuminance The luminance for this color.
inSaturation The saturation for this color.
Exceptions:
none 
Returns:
void

void CP_Color::ToHLS  )  [private]
 

Converts the color representaton to HLS. This will update the internal data fields if the color is not stored already in HLS form. This routine is used internally to convert from RGB to HLS.

Exceptions:
none 
Returns:
void

void CP_Color::ToRGB  )  [private]
 

Converts the color representaton to RGB. This will update the internal data fields if the color is not stored already in RGB form. This routine is used internally to convert from HLS to RGB.

Exceptions:
none 
Returns:
void

unsigned char CP_Color::ToRGB float  rm1,
float  rm2,
float  rh
[private]
 

Converts the passed in color parts to RGB and returns the conversion. This is called from the above ToRGB function to perform some of the conversion.

Parameters:
rm1 
rm2 
rh 
Exceptions:
none 
Returns:
unsigned char The converted color component.

CP_Color::operator RGBColor *  ) 
 

Returns this color as a RGBColor *.

Exceptions:
none 
Returns:
RGBColor * The color as an RGBColor *.

CP_Color::operator const RGBColor *  )  const
 

Returns this color as a RGBColor *, const version.

Exceptions:
none 
Returns:
RGBColor * const The color as an RGBColor *.

CP_Color::operator RGBColor  ) 
 

Returns this color as a RGBColor.

Exceptions:
none 
Returns:
RGBColor The color as an RGBColor.

CP_Color::operator const RGBColor  )  const
 

Returns this color as a RGBColor const version.

Exceptions:
none 
Returns:
RGBColor const The color as an RGBColor.

void CP_Color::Set const RGBColor  inColor  ) 
 

Sets the color from the passed in MacOS RGBColor.

Parameters:
inColor MacOS RGBColor to set this color from.
Exceptions:
none 
Returns:
void

COLORREF CP_Color::GetCOLORREF  )  const
 

Returns this color as a Windows COLORREF.

Exceptions:
none 
Returns:
COLORREF const The color a Windows COLORREF.

CP_Color::operator COLORREF  )  const
 

Return the color as a Windows COLORREF.

Exceptions:
none 
Returns:
COLORREF Windows COLORREF of this color.

void CP_Color::Set COLORREF  inColor  ) 
 

Sets this color from a Windows COLORREF.

Parameters:
inColor Windows COLORREF to set the color from.
Exceptions:
none 
Returns:
void

GdkColor* CP_Color::GetGDKColor  ) 
 

Return the color as a GdkColor.

Exceptions:
none 
Returns:
GdkColor GdkColor of this color.


Member Data Documentation

UInt16 CP_Color::fRed [protected]
 

UInt16 CP_Color::fGreen [protected]
 

The red color component.

UInt16 CP_Color::fBlue [protected]
 

The green color component.

float CP_Color::fHue [protected]
 

The blue color component.

float CP_Color::fSaturation [protected]
 

The hue component

float CP_Color::fLuminance [protected]
 

The saturation component.

bool CP_Color::fIsRGB [protected]
 

The luminance component.

bool CP_Color::fIsHLS [protected]
 

Flag to indicate if state is in rgb.

UInt32 CP_Color::fColorRef [protected]
 

Flag to indicate if state is in hls.

CPLAT_Begin_Namespace_CPLAT const CP_Color::CP_S_NamedColor CP_Color::fNamedColors [static, protected]
 

GdkColor* CP_Color::fGDKColor [protected]
 


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:27 2005 for CPLAT by  doxygen 1.4.0