libelemental 1.2.0
Public Member Functions | Public Attributes

Elemental::color Struct Reference

A color description. More...

#include <value.hh>

List of all members.

Public Member Functions

 color (double red=0.0, double green=0.0, double blue=0.0) throw ()
 Constructs a new color with red, green, and blue percentages.
 color (unsigned int red, unsigned int green, unsigned int blue) throw ()
 Constructs a new color with red, green, and blue levels.
double get_luminance () const throw ()
 Returns the luminous intensity of the color.
color get_compliment () const throw ()
 Returns a grayscale color complimentary in luminance to this color.
color composite (const color &other, double alpha) const throw ()
 Returns a composite of this color and another.
std::string get_hex_spec () const throw ()
 Returns a hexadecimal specification of the color ("#rrggbb" format).

Public Attributes

double red
 The red component of the color in the RGB space.
double green
 The green component of the color in the RGB space.
double blue
 The blue component of the color in the RGB space.

Detailed Description

A color description.

Its components are suitable as parameters to Gdk::Color::set_rgb_p().


Constructor & Destructor Documentation

Elemental::color::color ( unsigned int  red,
unsigned int  green,
unsigned int  blue 
) throw ()

Constructs a new color with red, green, and blue levels.

Each component ranges from 0 (0.0) to 65535 (1.0).


Member Function Documentation

color Elemental::color::composite ( const color other,
double  alpha 
) const throw ()

Returns a composite of this color and another.

Parameters:
otherA color with which this color will be composited.
alphaThe level of the other color in the composite, between 0.0 and 1.0.

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