manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ 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.

Parameter of mglVar: float r, g, b

Reg, green and blue component of color.

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.

Method on mglColor: void Set (char p)

Sets color from symbolic id.

Method on mglColor: bool Valid ()

Checks correctness of the color.

Method on mglColor: float Norm ()

Gets maximal of spectral component.

Method on mglColor: bool operator== (const mglColor &c)

Compare with another color

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.

Library Function: inline mglColor operator/ (const mglColor &a, float b)

Divide color by number.

Library Function: inline mglColor operator! (const mglColor &a)

Return inverted color.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.