Definition
The data type color is the type of all colors available for drawing operations in windows (cf. Windows). 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. The number of available colors is restricted and depends on the underlying hardware. Colors can be created from rgb-values, from names in a color data base (X11), or from the 16 integer constants (enumeration in < LEDA/incl/impl/x_window.htex2html_wrap_inline> ) black, white, red, green, blue, yellow, violet, orange; cyan, brown, pink, green2, blue2, grey1, grey2, grey3.
#include < LEDA/color.h >
Creation
color | col | creates a color with rgb-value (0, 0, 0) (i.e. black). |
color | col(int r, int g, int b) | creates a color with rgb-value (r, g, b). |
color | col(const char* name) | creates a color and initializes it with the rgb-value of color name from the X11 color data base ((0, 0, 0) if name does not exist). |
color | col(int i) | creates a color and initializes it with one of the 16 predefined colors. Here i is one of the 16 integer constants black, white, red, green, blue, yellow, violet, orange, cyan, brown, pink, green2, blue2, grey1, grey2, or grey3. |
Operations