Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Colors (CGAL_Color)

Definition

An object of the class CGAL_Color is a color available for drawing operations in CGAL output streams. Each color is defined by a triple of integers (r,g,b) with 0<=r,g,b <=255, the so-called rgb-value of the color.

Creation

CGAL_Color c;
creates a color with rgb-value (0,0,0), i.e. black.

CGAL_Color c ( int red, int green, int blue);
creates a color with rgb-value (red,green,blue).

Operations

bool c == q Test for equality: Two colors are equal, iff their rgb-values are equal.
bool c != q Test for inequality.
int c.red () returns the red component of c.
int c.green () returns the green component of c.
int c.blue () returns the blue component of c.

Constants

The following constants are predefined:

const CGAL_Color CGAL_BLACK = CGAL_Color(0, 0, 0);
Black.
const CGAL_Color CGAL_WHITE = CGAL_Color(255, 255, 255);
White.
const CGAL_Color CGAL_RED = CGAL_Color(255, 0, 0);
Red.
const CGAL_Color CGAL_GREEN = CGAL_Color(0, 255, 0);
Green.
const CGAL_Color CGAL_BLUE = CGAL_Color(0, 0, 255);
Blue.
const CGAL_Color CGAL_VIOLET = CGAL_Color(255, 0, 255);
Violet.
const CGAL_Color CGAL_ORANGE = CGAL_Color(255, 170, 0);
Orange.


Return to chapter: Colors
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. Wed, January 20, 1999.