[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.3 mglColor class
Structure for working with colors. This structure is defined in #include <mgl2/type.h>
.
There are two ways to set the color in MathGL. First one is using of mreal values of red, green and blue channels for precise color definition. The second way is the using of character id. There are a set of characters specifying frequently used colors. Normally capital letter gives more dark color than lowercase one. See section Line styles.
- Method on mglColor:
mglColor (
mreal
R,mreal
G,mreal
B,mreal
A=1
) Constructor sets the color by mreal values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1].
- Method on mglColor:
mglColor (
char
c='k'
,mreal
bright=1
) Constructor sets the color from character id. The black color is used by default. Parameter br set additional “lightness” of color.
- Method on mglColor:
void
Set (mreal
R,mreal
G,mreal
B,mreal
A=1
) Sets color from values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1].
- Method on mglColor:
void
Set (mglColor
c,mreal
bright=1
) Sets color as “lighted” version of color c.
- Method on mglColor:
bool
operator== (const mglColor &
c) - Method on mglColor:
bool
operator!= (const mglColor &
c) Compare with another color
- Library Function: mglColor operator+ (
const mglColor &
a,const mglColor &
b) Adds colors by its RGB values.
- Library Function:
mglColor
operator- (const mglColor &
a,const mglColor &
b) Subtracts colors by its RGB values.
- Library Function:
mglColor
operator* (const mglColor &
a,mreal
b) - Library Function:
mglColor
operator* (mreal
a,const mglColor &
b) Multiplies color by number.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 21, 2014 using texi2html 5.0.