[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
7.4 mglColor class
Structure for working with colors. This structure is defined in #include <mgl/mgl.h>
.
There are two ways to set the color in MathGL. First one is using of float 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 (
float
R,float
G,float
B) Constructor sets the color by float values of Red, Green and Blue channels.
- Method on mglColor:
mglColor (
char
c='k'
) Constructor sets the color from character id. The black color is used by default.
- Method on mglColor:
void
Set (float
R,float
G,float
B) Sets color from values of Red, Green and Blue channels. This values should be in interval [0,1].
- Method on mglColor:
void
Set (mglColor
c,float
bright=1
) Sets color as “lighted” version of color c.
- Library Function: inline mglColor operator+ (
const mglColor &
a,const mglColor &
b) Adds colors by its RGB values.
- Library Function: inline mglColor operator- (
const mglColor &
a,const mglColor &
b) Subtracts colors by its RGB values.
- Library Function: inline mglColor operator* (
const mglColor &
a,float
b) Multiplies color by number.
- Library Function: inline mglColor operator* (
float
a,const mglColor &
b) Multiplies color by number.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |