Classes | Typedefs | Functions | Variables
Rose::Color Namespace Reference




class  Gradient
 Mapping from floating point to color. More...
class  HSV
 Colors in HSV space. More...
class  RGB
 Colors in RGB space. More...


typedef double Component
 Type for color components. More...


template<typename T >
clip (T c)
 Clip a floating point value between 0 and 1. More...
HSV invertBrightness (const HSV &)
 Invert the brightness. More...
ROSE_UTIL_API HSV darken (const HSV &, double amount)
 Darken a color. More...
ROSE_UTIL_API HSV lighten (const HSV &, double amount)
 Lighten a color. More...
ROSE_UTIL_API HSV fade (const HSV &, double amount)
 Make a color less saturated. More...
ROSE_UTIL_API std::string toHtml (const RGB &)
 Create an HTML color string. More...
std::ostream & operator<< (std::ostream &, const RGB &)
std::ostream & operator<< (std::ostream &, const HSV &)
std::ostream & operator<< (std::ostream &, const Gradient &)


const HSV clear
const HSV black
const HSV white
const HSV red
const HSV green
const HSV blue
const HSV cyan
const HSV magenta
const HSV yellow
const HSV gray

Typedef Documentation

typedef double Rose::Color::Component

Type for color components.

FIXME[Robb P. Matzke 2014-12-19]: This should ideally be a template parameter so we can support 8-bit color, 16-bit color, floating point color using float or double, etc. At the moment, we'll use double since I don't expect that ROSE will be doing any heavy lifting of colors; i.e., no large image arrays, just color configuration kinds of things.

Definition at line 19 of file Color.h.

Function Documentation

template<typename T >
T Rose::Color::clip ( c)

Clip a floating point value between 0 and 1.

Definition at line 24 of file Color.h.

HSV Rose::Color::invertBrightness ( const HSV )

Invert the brightness.

Light colors will become dark, dark colors will become light. The hue, saturation and alpha are not affected.

ROSE_UTIL_API HSV Rose::Color::darken ( const HSV ,
double  amount 

Darken a color.

Makes a color darker according to amount, which should be in the range [0..1]. If amount is zero then the value is not changed, if amount is one then the color becomes black, others are interpolated linearly. This method does not affect the hue, saturation, or alpha.

ROSE_UTIL_API HSV Rose::Color::lighten ( const HSV ,
double  amount 

Lighten a color.

Makes a color lighter by adjusting its value upward by the specified ratio. A value of zero does not affect the lightness while a value of one will make it white. Other values are linearly interpolated between those two points.

ROSE_UTIL_API HSV Rose::Color::fade ( const HSV ,
double  amount 

Make a color less saturated.

Makes a color less saturated according to amount. An amount of zero does not change the saturation, one removes all saturation, and other values are linearly interpolated between those two extremes.

ROSE_UTIL_API std::string Rose::Color::toHtml ( const RGB )

Create an HTML color string.

HTML color strings are of the form "#RRGGBB".