CL_Color Class Reference
[clanDisplay 2D]

Color description class. More...

#include <color.h>

List of all members.

Public Member Functions

Construction

 CL_Color ()
 Constructs a color.
 CL_Color (const CL_Colord &)
 CL_Color (const CL_Colorf &)
 CL_Color (unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha=255)
 Constructs a color.
 CL_Color (const CL_StringRef &hexstr)
 Constructs a color.
Operations

void set_alpha (unsigned int value)
 Set alpha color component, in the range 0-255.
void set_red (unsigned int value)
 Set red color component, in the range 0-255.
void set_green (unsigned int value)
 Set green color component, in the range 0-255.
void set_blue (unsigned int value)
 Set blue color component, in the range 0-255.
void set_alpha_d (float value)
 Set alpha color component, in the range 0-1.
void set_red_d (float value)
 Set red color component, in the range 0-1.
void set_green_d (float value)
 Set green color component, in the range 0-1.
void set_blue_d (float value)
 Set blue color component, in the range 0-1.
void set_color (unsigned int red, unsigned int green, unsigned int blue, unsigned int alpha=255)
 Set color based on rgba color components in the range 0-255.
void set_color_d (float red, float green, float blue, float alpha=1.0)
 Set color based on rgba color components in the range 0-1.

Attributes



unsigned int color
 Color in ARGB8888 format.
unsigned int get_alpha () const
 Returns the alpha color component, in the range 0-255.
unsigned int get_red () const
 Returns the red color component, in the range 0-255.
unsigned int get_green () const
 Returns the green color component, in the range 0-255.
unsigned int get_blue () const
 Returns the blue color component, in the range 0-255.
double get_alpha_d () const
 Returns the alpha color component, in the range 0-1.
double get_red_d () const
 Returns the red color component, in the range 0-1.
double get_green_d () const
 Returns the green color component, in the range 0-1.
double get_blue_d () const
 Returns the blue color component, in the range 0-1.
float get_alpha_f () const
 Returns the alpha color component, in the range 0-1.
float get_red_f () const
 Returns the red color component, in the range 0-1.
float get_green_f () const
 Returns the green color component, in the range 0-1.
float get_blue_f () const
 Returns the blue color component, in the range 0-1.
bool operator== (const CL_Color &c) const
 Color == Color operator (deep compare).
bool operator!= (const CL_Color &c) const
 Color != Color operator (deep compare).

Statics



static CL_Color aliceblue
static CL_Color antiquewhite
static CL_Color aqua
static CL_Color aquamarine
static CL_Color azure
static CL_Color beige
static CL_Color bisque
static CL_Color black
static CL_Color blanchedalmond
static CL_Color blue
static CL_Color blueviolet
static CL_Color brown
static CL_Color burlywood
static CL_Color cadetblue
static CL_Color chartreuse
static CL_Color chocolate
static CL_Color coral
static CL_Color cornflowerblue
static CL_Color cornsilk
static CL_Color crimson
static CL_Color cyan
static CL_Color darkblue
static CL_Color darkcyan
static CL_Color darkgoldenrod
static CL_Color darkgray
static CL_Color darkgreen
static CL_Color darkgrey
static CL_Color darkkhaki
static CL_Color darkmagenta
static CL_Color darkolivegreen
static CL_Color darkorange
static CL_Color darkorchid
static CL_Color darkred
static CL_Color darksalmon
static CL_Color darkseagreen
static CL_Color darkslateblue
static CL_Color darkslategray
static CL_Color darkslategrey
static CL_Color darkturquoise
static CL_Color darkviolet
static CL_Color deeppink
static CL_Color deepskyblue
static CL_Color dimgray
static CL_Color dimgrey
static CL_Color dodgerblue
static CL_Color firebrick
static CL_Color floralwhite
static CL_Color forestgreen
static CL_Color fuchsia
static CL_Color gainsboro
static CL_Color ghostwhite
static CL_Color gold
static CL_Color goldenrod
static CL_Color gray
static CL_Color grey
static CL_Color green
static CL_Color greenyellow
static CL_Color honeydew
static CL_Color hotpink
static CL_Color indianred
static CL_Color indigo
static CL_Color ivory
static CL_Color khaki
static CL_Color lavender
static CL_Color lavenderblush
static CL_Color lawngreen
static CL_Color lemonchiffon
static CL_Color lightblue
static CL_Color lightcoral
static CL_Color lightcyan
static CL_Color lightgoldenrodyellow
static CL_Color lightgray
static CL_Color lightgreen
static CL_Color lightgrey
static CL_Color lightpink
static CL_Color lightsalmon
static CL_Color lightseagreen
static CL_Color lightskyblue
static CL_Color lightslategray
static CL_Color lightslategrey
static CL_Color lightsteelblue
static CL_Color lightyellow
static CL_Color lime
static CL_Color limegreen
static CL_Color linen
static CL_Color magenta
static CL_Color maroon
static CL_Color mediumaquamarine
static CL_Color mediumblue
static CL_Color mediumorchid
static CL_Color mediumpurple
static CL_Color mediumseagreen
static CL_Color mediumslateblue
static CL_Color mediumspringgreen
static CL_Color mediumturquoise
static CL_Color mediumvioletred
static CL_Color midnightblue
static CL_Color mintcream
static CL_Color mistyrose
static CL_Color moccasin
static CL_Color navajowhite
static CL_Color navy
static CL_Color oldlace
static CL_Color olive
static CL_Color olivedrab
static CL_Color orange
static CL_Color orangered
static CL_Color orchid
static CL_Color palegoldenrod
static CL_Color palegreen
static CL_Color paleturquoise
static CL_Color palevioletred
static CL_Color papayawhip
static CL_Color peachpuff
static CL_Color peru
static CL_Color pink
static CL_Color plum
static CL_Color powderblue
static CL_Color purple
static CL_Color red
static CL_Color rosybrown
static CL_Color royalblue
static CL_Color saddlebrown
static CL_Color salmon
static CL_Color sandybrown
static CL_Color seagreen
static CL_Color seashell
static CL_Color sienna
static CL_Color silver
static CL_Color skyblue
static CL_Color slateblue
static CL_Color slategray
static CL_Color slategrey
static CL_Color snow
static CL_Color springgreen
static CL_Color steelblue
static CL_Color tan
static CL_Color teal
static CL_Color thistle
static CL_Color tomato
static CL_Color turquoise
static CL_Color violet
static CL_Color wheat
static CL_Color white
static CL_Color whitesmoke
static CL_Color yellow
static CL_Color yellowgreen
static CL_Color transparent
 rgba(0, 0, 0, 0).
static CL_Color gray10
static CL_Color gray20
static CL_Color gray30
static CL_Color gray40
static CL_Color gray50
static CL_Color gray60
static CL_Color gray70
static CL_Color gray80
static CL_Color gray90
static CL_Color find_color (const CL_StringRef &name)
 Find and returns the static color matching a string.
static std::vector< CL_String8 > & get_names ()
 Returns the names of static colors defined.

Detailed Description

Color description class.


Constructor & Destructor Documentation

CL_Color::CL_Color (  )  [inline]

Constructs a color.

CL_Color::CL_Color ( const CL_Colord  )  [explicit]
CL_Color::CL_Color ( const CL_Colorf  )  [explicit]
CL_Color::CL_Color ( unsigned int  red,
unsigned int  green,
unsigned int  blue,
unsigned int  alpha = 255 
) [inline]

Constructs a color.

Color components are specified in the range 0 to 255.
An alpha value of 0 means complete transparency, while 255 means completely opaque (solid).

Parameters:
red Red color component.
green Green color component.
blue Blue color component.
alpha Alpha (transparency) color component.
CL_Color::CL_Color ( const CL_StringRef hexstr  ) 

Constructs a color.

Color components are specified in the range 0 to 255.
An alpha value of 0 means complete transparency, while 255 means completely opaque (solid).

Parameters:
hexstr The colors rgba components as a hexadecimal string of the format "#rrggbbaa", where the '#' and "aa" parts are optional.

Member Function Documentation

static CL_Color CL_Color::find_color ( const CL_StringRef name  )  [static]

Find and returns the static color matching a string.

Parameters:
name Name of color to match, eg. "blue".
Returns:
Reference to matching static color, or transparent (rgba(0,0,0,0)) if there was no match.

Referenced by CL_Colord::CL_Colord(), and CL_Colorf::CL_Colorf().

unsigned int CL_Color::get_alpha (  )  const [inline]

Returns the alpha color component, in the range 0-255.

Referenced by CL_Sprite::set_color(), and CL_Image::set_color().

double CL_Color::get_alpha_d (  )  const [inline]

Returns the alpha color component, in the range 0-1.

float CL_Color::get_alpha_f (  )  const [inline]

Returns the alpha color component, in the range 0-1.

unsigned int CL_Color::get_blue (  )  const [inline]

Returns the blue color component, in the range 0-255.

Referenced by CL_Sprite::set_color(), and CL_Image::set_color().

double CL_Color::get_blue_d (  )  const [inline]

Returns the blue color component, in the range 0-1.

float CL_Color::get_blue_f (  )  const [inline]

Returns the blue color component, in the range 0-1.

unsigned int CL_Color::get_green (  )  const [inline]

Returns the green color component, in the range 0-255.

Referenced by CL_Sprite::set_color(), and CL_Image::set_color().

double CL_Color::get_green_d (  )  const [inline]

Returns the green color component, in the range 0-1.

float CL_Color::get_green_f (  )  const [inline]

Returns the green color component, in the range 0-1.

static std::vector<CL_String8>& CL_Color::get_names (  )  [static]

Returns the names of static colors defined.

unsigned int CL_Color::get_red (  )  const [inline]

Returns the red color component, in the range 0-255.

Referenced by CL_Sprite::set_color(), and CL_Image::set_color().

double CL_Color::get_red_d (  )  const [inline]

Returns the red color component, in the range 0-1.

float CL_Color::get_red_f (  )  const [inline]

Returns the red color component, in the range 0-1.

bool CL_Color::operator!= ( const CL_Color c  )  const [inline]

Color != Color operator (deep compare).

References color.

bool CL_Color::operator== ( const CL_Color c  )  const [inline]

Color == Color operator (deep compare).

References color.

void CL_Color::set_alpha ( unsigned int  value  )  [inline]

Set alpha color component, in the range 0-255.

void CL_Color::set_alpha_d ( float  value  )  [inline]

Set alpha color component, in the range 0-1.

void CL_Color::set_blue ( unsigned int  value  )  [inline]

Set blue color component, in the range 0-255.

void CL_Color::set_blue_d ( float  value  )  [inline]

Set blue color component, in the range 0-1.

void CL_Color::set_color ( unsigned int  red,
unsigned int  green,
unsigned int  blue,
unsigned int  alpha = 255 
) [inline]

Set color based on rgba color components in the range 0-255.

void CL_Color::set_color_d ( float  red,
float  green,
float  blue,
float  alpha = 1.0 
) [inline]

Set color based on rgba color components in the range 0-1.

void CL_Color::set_green ( unsigned int  value  )  [inline]

Set green color component, in the range 0-255.

void CL_Color::set_green_d ( float  value  )  [inline]

Set green color component, in the range 0-1.

void CL_Color::set_red ( unsigned int  value  )  [inline]

Set red color component, in the range 0-255.

void CL_Color::set_red_d ( float  value  )  [inline]

Set red color component, in the range 0-1.


Member Data Documentation

aliceblue-chip.png

rgb(240, 248, 255).

antiquewhite-chip.png

rgb(250, 235, 215).

aqua-chip.png

rgb( 0, 255, 255).

aquamarine-chip.png

rgb(127, 255, 212).

azure-chip.png

rgb(240, 255, 255).

beige-chip.png

rgb(245, 245, 220).

bisque-chip.png

rgb(255, 228, 196).

black-chip.png

rgb( 0, 0, 0).

blanchedalmond-chip.png

rgb(255, 235, 205).

blue-chip.png

rgb( 0, 0, 255).

blueviolet-chip.png

rgb(138, 43, 226).

brown-chip.png

rgb(165, 42, 42).

burlywood-chip.png

rgb(222, 184, 135).

cadetblue-chip.png

rgb( 95, 158, 160).

chartreuse-chip.png

rgb(127, 255, 0).

chocolate-chip.png

rgb(210, 105, 30).

unsigned int CL_Color::color

Color in ARGB8888 format.

Referenced by operator!=(), and operator==().

coral-chip.png

rgb(255, 127, 80).

cornflowerblue-chip.png

rgb(100, 149, 237).

cornsilk-chip.png

rgb(255, 248, 220).

crimson-chip.png

rgb(220, 20, 60).

cyan-chip.png

rgb( 0, 255, 255).

darkblue-chip.png

rgb( 0, 0, 139).

darkcyan-chip.png

rgb( 0, 139, 139).

darkgoldenrod-chip.png

rgb(184, 134, 11).

darkgray-chip.png

rgb(169, 169, 169).

darkgreen-chip.png

rgb( 0, 100, 0).

darkgrey-chip.png

rgb(169, 169, 169).

darkkhaki-chip.png

rgb(189, 183, 107).

darkmagenta-chip.png

rgb(139, 0, 139).

darkolivegreen-chip.png

rgb( 85, 107, 47).

darkorange-chip.png

rgb(255, 140, 0).

darkorchid-chip.png

rgb(153, 50, 204).

darkred-chip.png

rgb(139, 0, 0).

darksalmon-chip.png

rgb(233, 150, 122).

darkseagreen-chip.png

rgb(143, 188, 143).

darkslateblue-chip.png

rgb( 72, 61, 139).

darkslategray-chip.png

rgb( 47, 79, 79).

darkslategrey-chip.png

rgb( 47, 79, 79).

darkturquoise-chip.png

rgb( 0, 206, 209).

darkviolet-chip.png

rgb(148, 0, 211).

deeppink-chip.png

rgb(255, 20, 147).

deepskyblue-chip.png

rgb( 0, 191, 255).

dimgray-chip.png

rgb(105, 105, 105).

dimgrey-chip.png

rgb(105, 105, 105).

dodgerblue-chip.png

rgb( 30, 144, 255).

firebrick-chip.png

rgb(178, 34, 34).

floralwhite-chip.png

rgb(255, 250, 240).

forestgreen-chip.png

rgb( 34, 139, 34).

fuchsia-chip.png

rgb(255, 0, 255).

gainsboro-chip.png

rgb(220, 220, 220).

ghostwhite-chip.png

rgb(248, 248, 255).

gold-chip.png

rgb(255, 215, 0).

goldenrod-chip.png

rgb(218, 165, 32).

gray-chip.png

rgb(128, 128, 128).

green-chip.png

rgb( 0, 128, 0).

greenyellow-chip.png

rgb(173, 255, 47).

grey-chip.png

rgb(128, 128, 128).

honeydew-chip.png

rgb(240, 255, 240).

hotpink-chip.png

rgb(255, 105, 180).

indianred-chip.png

rgb(205, 92, 92).

indigo-chip.png

rgb( 75, 0, 130).

ivory-chip.png

rgb(255, 255, 240).

khaki-chip.png

rgb(240, 230, 140).

lavender-chip.png

rgb(230, 230, 250).

lavenderblush-chip.png

rgb(255, 240, 245).

lawngreen-chip.png

rgb(124, 252, 0).

lemonchiffon-chip.png

rgb(255, 250, 205).

lightblue-chip.png

rgb(173, 216, 230).

lightcoral-chip.png

rgb(240, 128, 128).

lightcyan-chip.png

rgb(224, 255, 255).

lightgoldenrodyellow-chip.png

rgb(250, 250, 210).

lightgray-chip.png

rgb(211, 211, 211).

lightgreen-chip.png

rgb(144, 238, 144).

lightgrey-chip.png

rgb(211, 211, 211).

lightpink-chip.png

rgb(255, 182, 193).

lightsalmon-chip.png

rgb(255, 160, 122).

lightseagreen-chip.png

rgb( 32, 178, 170).

lightskyblue-chip.png

rgb(135, 206, 250).

lightslategray-chip.png

rgb(119, 136, 153).

lightslategrey-chip.png

rgb(119, 136, 153).

lightsteelblue-chip.png

rgb(176, 196, 222).

lightyellow-chip.png

rgb(255, 255, 224).

lime-chip.png

rgb( 0, 255, 0).

limegreen-chip.png

rgb( 50, 205, 50).

linen-chip.png

rgb(250, 240, 230).

magenta-chip.png

rgb(255, 0, 255).

maroon-chip.png

rgb(128, 0, 0).

mediumaquamarine-chip.png

rgb(102, 205, 170).

mediumblue-chip.png

rgb( 0, 0, 205).

mediumorchid-chip.png

rgb(186, 85, 211).

mediumpurple-chip.png

rgb(147, 112, 219).

mediumseagreen-chip.png

rgb( 60, 179, 113).

mediumslateblue-chip.png

rgb(123, 104, 238).

mediumspringgreen-chip.png

rgb( 0, 250, 154).

mediumturquoise-chip.png

rgb( 72, 209, 204).

mediumvioletred-chip.png

rgb(199, 21, 133).

midnightblue-chip.png

rgb( 25, 25, 112).

mintcream-chip.png

rgb(245, 255, 250).

mistyrose-chip.png

rgb(255, 228, 225).

moccasin-chip.png

rgb(255, 228, 181).

navajowhite-chip.png

rgb(255, 222, 173).

navy-chip.png

rgb( 0, 0, 128).

oldlace-chip.png

rgb(253, 245, 230).

olive-chip.png

rgb(128, 128, 0).

olivedrab-chip.png

rgb(107, 142, 35).

orange-chip.png

rgb(255, 165, 0).

orangered-chip.png

rgb(255, 69, 0).

orchid-chip.png

rgb(218, 112, 214).

palegoldenrod-chip.png

rgb(238, 232, 170).

palegreen-chip.png

rgb(152, 251, 152).

paleturquoise-chip.png

rgb(175, 238, 238).

palevioletred-chip.png

rgb(219, 112, 147).

papayawhip-chip.png

rgb(255, 239, 213).

peachpuff-chip.png

rgb(255, 218, 185).

peru-chip.png

rgb(205, 133, 63).

pink-chip.png

rgb(255, 192, 203).

plum-chip.png

rgb(221, 160, 221).

powderblue-chip.png

rgb(176, 224, 230).

purple-chip.png

rgb(128, 0, 128).

red-chip.png

rgb(255, 0, 0).

rosybrown-chip.png

rgb(188, 143, 143).

royalblue-chip.png

rgb( 65, 105, 225).

saddlebrown-chip.png

rgb(139, 69, 19).

salmon-chip.png

rgb(250, 128, 114).

sandybrown-chip.png

rgb(244, 164, 96).

seagreen-chip.png

rgb( 46, 139, 87).

seashell-chip.png

rgb(255, 245, 238).

sienna-chip.png

rgb(160, 82, 45).

silver-chip.png

rgb(192, 192, 192).

skyblue-chip.png

rgb(135, 206, 235).

slateblue-chip.png

rgb(106, 90, 205).

slategray-chip.png

rgb(112, 128, 144).

slategrey-chip.png

rgb(112, 128, 144).

snow-chip.png

rgb(255, 250, 250).

springgreen-chip.png

rgb( 0, 255, 127).

steelblue-chip.png

rgb( 70, 130, 180).

tan-chip.png

rgb(210, 180, 140).

teal-chip.png

rgb( 0, 128, 128).

thistle-chip.png

rgb(216, 191, 216).

tomato-chip.png

rgb(255, 99, 71).

rgba(0, 0, 0, 0).

turquoise-chip.png

rgb( 64, 224, 208).

violet-chip.png

rgb(238, 130, 238).

wheat-chip.png

rgb(245, 222, 179).

white-chip.png

rgb(255, 255, 255).

whitesmoke-chip.png

rgb(245, 245, 245).

yellow-chip.png

rgb(255, 255, 0).

yellowgreen-chip.png

rgb(154, 205, 50).


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