You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Color object:

Class

Cvo_Color

Syntax

#include <Cvo/Color.h++>

Cvo_Color c( )
Cvo_Color c( Cvo_Color cvo_color )
Cvo_Color c( Cvo_BasicObject *object,
char *color,
[ int background ] )
Cvo_Color c( Cvo_BasicObject *object double hue,
double lightness,
double saturation,
[ int background ] )
Cvo_Color c( Cvo_BasicObject *object XColor xc,
[ int background ] )

Overview

The Cvo_Color object is used to store colors in Cvo. A color can be created in several ways, as shown above. When a color is created with no arguments it starts in the empty state, which means none of its member functions will actually work. Typically it is created with either a set of the arguments shown above, or it is assigned the value of another Cvo_Color object. In all the above creations, the optional argument background is used to determine what color should be used if the color is not found. If background is set to a non-zero value, the default background color is returned if the color cannot be allocated. If it is not specified, or is 0, the default foreground color is returned if the color cannot be allocated.

If cvo_color is given, it is copied to this Cvo_Color object.

If the string color is given, then a lookup is done for that color in the RGB database. The color name can be any valid X11 color name.

If hue, lightness and saturation are passed, a color is allocated according to those values. Hue ranges from 0.0 to 360.0, lightness and saturation range from 0 to 1.0.

If xc is given then the RGB values from xc are used to allocate the color.

This object generally should not be created as a pointer. See below.

Member Functions

This object defines the following member functions.

The Cvo_Color object is a smart pointer. This means that the object actually indirectly accesses the data associated with it. This allows for many Cvo_Color objects to actually refer to the same color/pixel value. Due to this, the Cvo_Color object has a somewhat unique method of accessing most of its member functions. All the functions listed below assume the name of the Color object is c. Note that c is not a pointer to a Cvo_Color object but the color object itself.


See the example source code for an example of how to use this object.


See the legend for information about the conventions used in this documentation.