Logo Search packages:      
Sourcecode: agave version File versions  Download package

gcs::Color Class Reference

#include <gcs-color.h>

List of all members.


Detailed Description

The Color class keeps track of a color by a couple different property sets that define a color.

The first property set is a specification of the color in terms of Red, Green, and Blue values (RGB). It also specifies the color in terms of Hue, Saturation, and Value (HSV). The RGB value can also be specified in a hex string, similar to how colors are usually specified in HTML and CSS.

Definition at line 46 of file gcs-color.h.


Public Member Functions

Gdk::Color & gdk (void) const
gint get_blue (void) const
gint get_green (void) const
tHexString get_hexstring () const
tColorHsv get_hsv (void) const
gint get_hue (void) const
gint get_luminance (void) const
Glib::ustring get_name () const
gint get_red (void) const
tColorRgb get_rgb (void) const
gint get_saturation (void) const
gint get_value (void) const
bool operator!= (const Color &c)
bool operator< (const Color &c)
Coloroperator= (const Color &c)
bool operator== (const Color &c)
bool set (const tHexString hex)
void set (const gint r, const gint g, const gint b, const Glib::ustring name=Glib::ustring())
void set_blue (const gint b)
void set_green (const gint g)
void set_hsv (tColorHsv)
void set_hue (const gint h)
void set_name (Glib::ustring name)
void set_red (const gint r)
void set_saturation (const gint s)
void set_value (const gint v)
 ~Color (void)

Static Public Member Functions

static ColorPtr create (const Color &)
static ColorPtr create (const Gdk::Color &)
static ColorPtr create (const gint r, const gint g, const gint b, const Glib::ustring name=Glib::ustring())
static ColorPtr create (tHexString str)
static ColorPtr create (void)
static tHexString normalize_hex (tHexString hex)
static gdouble rgb_as_p (gint rgbVal)
static tHexString rgb_to_hex (const tColorRgb color)
static tColorHsv rgb_to_hsv (const tColorRgb rgb)

Protected Member Functions

 Color (const Color &c)
 Color (const Gdk::Color &c)
 Color (const gint r, const gint g, const gint b, const Glib::ustring name=Glib::ustring())
 Color (const tHexString hex)

Private Attributes

Glib::ustring m_name
std::auto_ptr< Gdk::Color > pColor

Static Private Attributes

static const double m_blueLuminance = 0.0722
static const double m_greenLuminance = 0.7152
static const double m_redLuminance = 0.2126

Friends

std::ostream & operator<< (std::ostream &out, const ColorPtr c)
std::ostream & operator<< (std::ostream &out, const Color c)

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

Generated by  Doxygen 1.6.0   Back to index